GitFOSS
William Nemenchaimprove code
c048dc5 (parent 3e8b201)4/7/2024, 3:04:16 AM
.ts
TypeScript
(application/typescript)
// 3rd-party
import React from "react";
import type { ReactView } from "@ethicdevs/react-monolith";
import styled from "styled-components";

// app
import type { CommonProps } from "../types";
import { AppRoute } from "../routes.defs";
import { ButtonAnchor, Layout, PageWrapper } from "../components";
import { buildRouteLink } from "../utils/shared";

export interface HomeViewProps extends CommonProps {
  foo?: boolean;
}

const HomeView: ReactView<HomeViewProps> = (props) => {
  const { commonProps } = props;
  return (
    <Layout {...commonProps}>
      <PageWrapper>
        <StyledButtonsRow>
          <ButtonAnchor href={buildRouteLink(AppRoute.REPOSITORY_EXPLORE, {})}>
            Explore
          </ButtonAnchor>
          <ButtonAnchor href={buildRouteLink(AppRoute.AUTH_REGISTER, {})}>
            Register
          </ButtonAnchor>
          <ButtonAnchor href={buildRouteLink(AppRoute.AUTH_LOGIN, {})}>
            Login
          </ButtonAnchor>
        </StyledButtonsRow>
      </PageWrapper>
    </Layout>
  );
};

const StyledButtonsRow = styled.div`
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  width: 100%;
`;

HomeView.displayName = "HomeView";
export default HomeView;