@ethicdevs/gitfoss | Show object: 6a58c841a634337b5095bbfba4d656db17e11223 ∙ GitFOSS
fix(home): isOdd/isEven ...
+ 42
- 89
app/views/HomeView.tsx
@@ -247,104 +247,57 @@ const HomeView: ReactView<HomeViewProps> = (props) => {
                   .feature-section {
                     flex-direction: column;
                   }
-                  .is-even {
-                    flex-direction: column;
-                  }
+                  .is-even,
                   .is-odd {
-                    flex-direction: column-reverse;
+                    flex-direction: column;
                   }
                 }
               `}</style>
-              {isEven && (
-                <div className="feature-section is-even">
-                  <div style={{ flex: 1, minWidth: 260 }}>
-                    <img
-                      src={imageSrc}
-                      alt={`${f.title} illustration`}
-                      style={{
-                        width: "100%",
-                        height: "auto",
-                        borderRadius: 24,
-                      }}
-                    />
-                  </div>
-                  <div style={{ flex: 1, minWidth: 260 }}>
-                    <h1 style={{ margin: 0, fontSize: 48 }}>{f.title}</h1>
-                    <h3
-                      className="feature-desc"
-                      style={{
-                        color: "#777777",
-                        lineHeight: 1.4,
-                        fontWeight: "normal",
-                      }}
-                    >
-                      {genDesc}
-                    </h3>
-                    <div
-                      className="cta"
-                      style={{ display: "flex", gap: 8, marginTop: 16 }}
-                    >
-                      <Button
-                        as="a"
-                        href={buildRouteLink(AppRoute.AUTH_REGISTER, {})}
-                      >
-                        Register
-                      </Button>
-                      <Button
-                        as="a"
-                        href={buildRouteLink(AppRoute.AUTH_LOGIN, {})}
-                      >
-                        Login
-                      </Button>
-                    </div>
-                  </div>
+              <div
+                className={`feature-section ${isEven ? "is-even" : "is-odd"}`}
+              >
+                <div style={{ flex: 1, minWidth: 260 }}>
+                  <img
+                    src={imageSrc}
+                    alt={`${f.title} illustration`}
+                    style={{
+                      width: "100%",
+                      height: "auto",
+                      borderRadius: 24,
+                    }}
+                  />
                 </div>
-              )}
-              {!isEven && (
-                <div className="feature-section is-odd">
-                  <div style={{ flex: 1, minWidth: 260 }}>
-                    <h1 style={{ margin: 0, fontSize: 48 }}>{f.title}</h1>
-                    <h3
-                      className="feature-desc"
-                      style={{
-                        color: "#777777",
-                        lineHeight: 1.4,
-                        fontWeight: "normal",
-                      }}
+                <div style={{ flex: 1, minWidth: 260 }}>
+                  <h1 style={{ margin: 0, fontSize: 48 }}>{f.title}</h1>
+                  <h3
+                    className="feature-desc"
+                    style={{
+                      color: "#777777",
+                      lineHeight: 1.4,
+                      fontWeight: "normal",
+                    }}
+                  >
+                    {genDesc}
+                  </h3>
+                  <div
+                    className="cta"
+                    style={{ display: "flex", gap: 8, marginTop: 16 }}
+                  >
+                    <Button
+                      as="a"
+                      href={buildRouteLink(AppRoute.AUTH_REGISTER, {})}
                     >
-                      {genDesc}
-                    </h3>
-                    <div
-                      className="cta"
-                      style={{ display: "flex", gap: 8, marginTop: 16 }}
+                      Register
+                    </Button>
+                    <Button
+                      as="a"
+                      href={buildRouteLink(AppRoute.AUTH_LOGIN, {})}
                     >
-                      <Button
-                        as="a"
-                        href={buildRouteLink(AppRoute.AUTH_REGISTER, {})}
-                      >
-                        Register
-                      </Button>
-                      <Button
-                        as="a"
-                        href={buildRouteLink(AppRoute.AUTH_LOGIN, {})}
-                      >
-                        Login
-                      </Button>
-                    </div>
-                  </div>
-                  <div style={{ flex: 1, minWidth: 260 }}>
-                    <img
-                      src={imageSrc}
-                      alt={`${f.title} illustration`}
-                      style={{
-                        width: "100%",
-                        height: "auto",
-                        borderRadius: 24,
-                      }}
-                    />
+                      Login
+                    </Button>
                   </div>
                 </div>
-              )}
+              </div>
             </section>
           );
         })}