-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: jankun4 <michaljankun@gmail.com>
- Loading branch information
Showing
70 changed files
with
1,627 additions
and
718 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
FROM haskell:9.2-buster | ||
ARG BASE_IMAGE_TAG | ||
FROM 733019650473.dkr.ecr.eu-west-1.amazonaws.com/backend-base:$BASE_IMAGE_TAG | ||
WORKDIR /src | ||
COPY . . | ||
RUN cabal update && cabal configure && cabal build | ||
RUN cabal build | ||
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.8/vva-be-0.1.0.0/x/vva-be/build/vva-be/vva-be /usr/local/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# NOTE: This Dockerfile sets up an environment with precompiled dependencies for | ||
# the GovTool Haskell backend project, streamlining the project's compilation | ||
# process by ensuring it only needs to compile against these dependencies. This | ||
# is a common practice in Haskell projects, as it can significantly reduce the | ||
# time it takes to build the project. | ||
|
||
FROM haskell:9.2-buster | ||
WORKDIR /src | ||
COPY . . | ||
RUN cabal update && cabal configure && cabal install --only-dependencies && rm -rf /src/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
govtool/frontend/src/components/molecules/CenteredBoxBottomButtons.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { useMemo } from "react"; | ||
import { Box } from "@mui/material"; | ||
|
||
import { Button, LoadingButton } from "@atoms"; | ||
import { useScreenDimension, useTranslation } from "@hooks"; | ||
|
||
interface Props { | ||
onBackButton: () => void; | ||
onActionButton: () => void; | ||
isLoading?: boolean; | ||
backButtonText?: string; | ||
actionButtonText?: string; | ||
} | ||
|
||
export const CenteredBoxBottomButtons = ({ | ||
onBackButton, | ||
onActionButton, | ||
isLoading, | ||
backButtonText, | ||
actionButtonText, | ||
}: Props) => { | ||
const { isMobile } = useScreenDimension(); | ||
const { t } = useTranslation(); | ||
|
||
const renderBackButton = useMemo(() => { | ||
return ( | ||
<Button | ||
data-testid={"back-button"} | ||
onClick={onBackButton} | ||
size="extraLarge" | ||
sx={{ | ||
px: 6, | ||
}} | ||
variant="outlined" | ||
> | ||
{backButtonText ?? t("cancel")} | ||
</Button> | ||
); | ||
}, [isMobile]); | ||
|
||
const renderActionButton = useMemo(() => { | ||
return ( | ||
<LoadingButton | ||
data-testid={"register-button"} | ||
isLoading={isLoading} | ||
onClick={onActionButton} | ||
sx={{ | ||
px: 6, | ||
height: 48, | ||
fontSize: 16, | ||
}} | ||
variant="contained" | ||
> | ||
{actionButtonText ?? t("continue")} | ||
</LoadingButton> | ||
); | ||
}, [isLoading, isMobile]); | ||
|
||
return ( | ||
<Box | ||
display="flex" | ||
flexDirection={isMobile ? "column-reverse" : "row"} | ||
justifyContent="space-around" | ||
mt={6} | ||
> | ||
{renderBackButton} | ||
<Box px={2} py={isMobile ? 1.5 : 0} /> | ||
{renderActionButton} | ||
</Box> | ||
); | ||
}; |
108 changes: 108 additions & 0 deletions
108
govtool/frontend/src/components/molecules/CenteredBoxPageWrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import { FC, PropsWithChildren } from "react"; | ||
import { Box, Link } from "@mui/material"; | ||
|
||
import { Background, Typography } from "@atoms"; | ||
import { ICONS } from "@consts"; | ||
import { DashboardTopNav } from "@organisms"; | ||
import { useScreenDimension } from "@hooks"; | ||
import { useNavigate } from "react-router-dom"; | ||
import { theme } from "@/theme"; | ||
|
||
interface Props { | ||
pageTitle: string; | ||
backButtonText: string; | ||
backButtonPath: string; | ||
isVotingPowerHidden?: boolean; | ||
} | ||
export const CenteredBoxPageWrapper: FC<PropsWithChildren<Props>> = ({ | ||
pageTitle, | ||
backButtonText, | ||
backButtonPath, | ||
isVotingPowerHidden, | ||
children, | ||
}) => { | ||
const { isMobile, screenWidth, pagePadding } = useScreenDimension(); | ||
const navigate = useNavigate(); | ||
const { | ||
palette: { boxShadow2 }, | ||
} = theme; | ||
|
||
return ( | ||
<Background isReverted> | ||
<Box display={"flex"} minHeight={"100vh"} flexDirection="column"> | ||
<DashboardTopNav | ||
imageSRC={ICONS.appLogoIcon} | ||
imageWidth={isMobile ? undefined : 42} | ||
imageHeight={isMobile ? 24 : 35} | ||
title={pageTitle} | ||
isVotingPowerHidden={isVotingPowerHidden} | ||
/> | ||
<Box | ||
display={"flex"} | ||
justifyContent={"center"} | ||
flexDirection={"column"} | ||
mt={isMobile ? 0 : 7} | ||
height={isMobile ? "100%" : "auto"} | ||
sx={{ marginTop: "97px" }} | ||
> | ||
{isMobile && ( | ||
<Box borderBottom={1} borderColor={"#fff"}> | ||
<Typography | ||
variant="body2" | ||
sx={{ | ||
ml: 2, | ||
my: "26px", | ||
fontSize: "24px", | ||
fontWeight: 400, | ||
}} | ||
> | ||
{pageTitle} | ||
</Typography> | ||
</Box> | ||
)} | ||
<Link | ||
data-testid={"back-button"} | ||
sx={{ | ||
cursor: "pointer", | ||
display: "flex", | ||
textDecoration: "none", | ||
my: 3, | ||
marginLeft: isMobile ? 2 : "40px", | ||
}} | ||
onClick={() => navigate(backButtonPath)} | ||
> | ||
<img | ||
src={ICONS.arrowLeftThinIcon} | ||
alt="arrow" | ||
style={{ marginRight: "4px" }} | ||
/> | ||
<Typography | ||
variant="body2" | ||
color="primary" | ||
sx={{ | ||
fontWeight: 400, | ||
paddingTop: "1px", | ||
}} | ||
> | ||
{backButtonText} | ||
</Typography> | ||
</Link> | ||
<Box display={"flex"} justifyContent={"center"}> | ||
<Box | ||
width={screenWidth < 768 ? "auto" : "52vw"} | ||
boxShadow={isMobile ? "" : `2px 2px 20px 0px ${boxShadow2}`} | ||
px={pagePadding} | ||
py={isMobile ? 3 : 8} | ||
borderRadius={"20px"} | ||
height="auto" | ||
> | ||
<Box display="flex" flexDirection="column"> | ||
{children} | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Background> | ||
); | ||
}; |
Oops, something went wrong.