-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
312 additions
and
290 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
26 changes: 26 additions & 0 deletions
26
src/ui/screens/activity-log/components/ActivityLogSection.js
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,26 @@ | ||
import React from "react"; | ||
import { Typography, Box } from "@mui/material"; | ||
import LandingPageSectionWrapper from "../../landing-page/components/LandingPageSectionWrapper"; | ||
import LandingPageSectionGrid from "../../landing-page/components/LandingPageSectionGrid"; | ||
|
||
const ActivityLogSection = ({ title, description, content, error }) => { | ||
return ( | ||
<LandingPageSectionWrapper> | ||
<LandingPageSectionGrid title={title}> | ||
<Box sx={{ marginBottom: 3 }}> | ||
<Typography variant="body1">{description}</Typography> | ||
</Box> | ||
<Box sx={{ width: "100%" }}> | ||
{content} | ||
{error && ( | ||
<Typography color="error" sx={{ marginTop: 2 }}> | ||
{error} | ||
</Typography> | ||
)} | ||
</Box> | ||
</LandingPageSectionGrid> | ||
</LandingPageSectionWrapper> | ||
); | ||
}; | ||
|
||
export default ActivityLogSection; |
43 changes: 11 additions & 32 deletions
43
src/ui/screens/activity-log/sections/commithistory/ActivityLogCommits.js
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,42 +1,21 @@ | ||
import React from "react"; | ||
import {Typography} from "@mui/material"; | ||
import LandingPageSectionWrapper from "../../../landing-page/components/LandingPageSectionWrapper"; | ||
import LandingPageSectionGrid from "../../../landing-page/components/LandingPageSectionGrid"; | ||
import VStack from "../../../../shared-components/VStack"; | ||
import ActivityLogSection from "../../components/ActivityLogSection"; | ||
import useFetchLatestCommitsHandler from "./hooks/useFetchLatestCommitsHandler"; | ||
import GithubCommitsList from "./components/GithubCommitsList"; | ||
import useTranslation from "../../../../language/useTranslation"; | ||
|
||
const ActivityLogCommits = ({isDesktop}) => { | ||
const ActivityLogCommits = () => { | ||
const { t } = useTranslation(); | ||
const { commits, error } = useFetchLatestCommitsHandler() | ||
const { commits, error } = useFetchLatestCommitsHandler(); | ||
|
||
return ( | ||
<LandingPageSectionWrapper isDesktop={isDesktop}> | ||
<LandingPageSectionGrid title={t('activityLog.gitCommits.title')}> | ||
<VStack> | ||
<Typography sx={styles.text}> | ||
{t('activityLog.gitCommits.description')} | ||
</Typography> | ||
</VStack> | ||
<VStack gap={5} sx={{width: '100%'}}> | ||
<GithubCommitsList commits={commits}/> | ||
</VStack> | ||
{error && ( | ||
<Typography color="error"> | ||
Commits cannot be loaded. | ||
</Typography> | ||
)} | ||
</LandingPageSectionGrid> | ||
</LandingPageSectionWrapper> | ||
) | ||
} | ||
|
||
const styles = { | ||
text: { | ||
fontSize: '20px', | ||
textAlign: 'left', | ||
}, | ||
} | ||
<ActivityLogSection | ||
title={t("activityLog.gitCommits.title")} | ||
description={t("activityLog.gitCommits.description")} | ||
content={<GithubCommitsList commits={commits} />} | ||
error={error ? "Commits cannot be loaded." : null} | ||
/> | ||
); | ||
}; | ||
|
||
export default ActivityLogCommits; |
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: 32 additions & 39 deletions
71
src/ui/screens/activity-log/sections/commithistory/components/GithubCommitsList.js
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,47 +1,40 @@ | ||
import React from 'react'; | ||
import {Typography} from "@mui/material"; | ||
import VStack from "../../../../../shared-components/VStack"; | ||
import HStack from "../../../../../shared-components/HStack"; | ||
import React from "react"; | ||
import { Typography, Box } from "@mui/material"; | ||
import GithubCommitElement from "./GithubCommitElement"; | ||
import useTranslation from "../../../../../language/useTranslation"; | ||
|
||
const GithubCommitsList = ({commits}) => { | ||
const GithubCommitsList = ({ commits }) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<VStack sx={{width: '100%'}}> | ||
<HStack justifyContent={'flex-end'} sx={styles.listHeaderBox}> | ||
<Typography sx={styles.listTitle}> | ||
{t('activityLog.gitCommits.listTitle')} | ||
</Typography> | ||
</HStack> | ||
<VStack> | ||
{ | ||
commits.map((item, index) => { | ||
return ( | ||
<GithubCommitElement | ||
key={index} | ||
commit={item} | ||
showBorderBottom={index < commits.length - 1} | ||
/> | ||
) | ||
}) | ||
} | ||
</VStack> | ||
</VStack> | ||
) | ||
} | ||
|
||
const styles = { | ||
listHeaderBox: { | ||
width: '100%', | ||
borderBottom: '2px solid rgba(189, 189, 189)', | ||
}, | ||
listTitle: { | ||
fontSize: '20px', | ||
fontWeight: 'bold' | ||
} | ||
} | ||
<Box sx={{ width: "100%" }}> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
justifyContent: "flex-end", | ||
borderBottom: "2px solid", | ||
borderColor: "divider", | ||
marginBottom: 1, | ||
}} | ||
> | ||
<Typography variant="h6">{t("activityLog.gitCommits.listTitle")}</Typography> | ||
</Box> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
"& > *:not(:last-child)": { | ||
borderBottom: "1px solid", | ||
borderColor: "divider", | ||
}, | ||
}} | ||
> | ||
{commits.map((item) => ( | ||
<GithubCommitElement key={item.sha || item.id} commit={item} /> | ||
))} | ||
</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default GithubCommitsList; | ||
|
Oops, something went wrong.