Skip to content

Commit

Permalink
Improve style and fix links of dev toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
kachar committed Sep 30, 2021
1 parent 5366e37 commit 520efc2
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/components/auth/login/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function LoginPage({ csrfToken }: LoginPageProps) {
return (
<Layout
title={t('nav.login')}
githubUrl="https://github.com/podkrepi-bg/frontend/tree/master/frontend/src/components/auth/login/LoginPage.tsx"
githubUrl="https://github.com/podkrepi-bg/frontend/tree/master/src/components/auth/login/LoginPage.tsx"
figmaUrl="https://www.figma.com/file/MmvFKzUv6yE5U2wrOpWtwS/Podkrepi.bg?node-id=5055%3A21469">
<Container maxWidth="xs">
<LoginForm csrfToken={csrfToken || ''} />
Expand Down
4 changes: 2 additions & 2 deletions src/components/auth/profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function ProfilePage() {
return (
<Layout
title={t('nav.profile')}
githubUrl="https://github.com/podkrepi-bg/frontend/tree/master/frontend/src/components/auth/profile/ProfilePage.tsx"
githubUrl="https://github.com/podkrepi-bg/frontend/tree/master/src/components/auth/profile/ProfilePage.tsx"
figmaUrl="https://www.figma.com/file/MmvFKzUv6yE5U2wrOpWtwS/Podkrepi.bg?node-id=5987%3A21094">
Not authenticated
</Layout>
Expand All @@ -59,7 +59,7 @@ export default function ProfilePage() {
return (
<Layout
title={t('nav.profile')}
githubUrl="https://github.com/podkrepi-bg/frontend/tree/master/frontend/src/components/auth/profile/ProfilePage.tsx"
githubUrl="https://github.com/podkrepi-bg/frontend/tree/master/src/components/auth/profile/ProfilePage.tsx"
figmaUrl="https://www.figma.com/file/MmvFKzUv6yE5U2wrOpWtwS/Podkrepi.bg?node-id=5987%3A21094">
<Container maxWidth="xl">
<Grid container direction="row" justify="space-between">
Expand Down
2 changes: 1 addition & 1 deletion src/components/campaigns/CampaignsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function CampaignsPage() {
return (
<Layout
title={t('nav.campaigns.index')}
githubUrl="https://github.com/podkrepi-bg/frontend/tree/master/frontend/src/components/campaigns/CampaignsPage.tsx"
githubUrl="https://github.com/podkrepi-bg/frontend/tree/master/src/components/campaigns/CampaignsPage.tsx"
figmaUrl="https://www.figma.com/file/MmvFKzUv6yE5U2wrOpWtwS/Podkrepi.bg?node-id=5100%3A21216">
<Container maxWidth="lg">
<Box textAlign="center" marginBottom={4}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/campaigns/CreateCampaignPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function CreateCampaignPage() {
return (
<Layout
title={t('nav.campaigns.index')}
githubUrl="https://github.com/podkrepi-bg/frontend/tree/master/frontend/src/components/campaigns/CreateCampaignPage.tsx"
githubUrl="https://github.com/podkrepi-bg/frontend/tree/master/src/components/campaigns/CreateCampaignPage.tsx"
figmaUrl="https://www.figma.com/file/MmvFKzUv6yE5U2wrOpWtwS/Podkrepi.bg?node-id=5055%3A21345">
<Container maxWidth="sm">
<CampaignForm />
Expand Down
60 changes: 35 additions & 25 deletions src/components/layout/ImproveThisPageTag.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
import { Box, Button } from '@material-ui/core'
import { GitHub, Web } from '@material-ui/icons'
import { useTranslation } from 'next-i18next'
import { GitHub, Web } from '@material-ui/icons'
import { Alert, AlertTitle } from '@material-ui/lab'
import { Box, Button, Container } from '@material-ui/core'

type Props = {
githubUrl: string
figmaUrl: string
githubUrl?: string
figmaUrl?: string
}

export default function ImproveThisPageTag({ githubUrl, figmaUrl }: Props) {
const { t } = useTranslation()
if (!githubUrl && !figmaUrl) return null
return (
<Box textAlign="center" margin={2} position="absolute" right="0" top="7rem">
{t('improve-this-page')}
<Button
href={githubUrl}
size="small"
variant="text"
target="_blank"
rel="noreferrer noopener"
startIcon={<GitHub fontSize="small" />}>
{t('github-link-text')}
</Button>
<Button
href={figmaUrl}
size="small"
variant="text"
target="_blank"
rel="noreferrer noopener"
startIcon={<Web fontSize="small" />}>
{t('figma-link-text')}
</Button>
</Box>
<Container maxWidth="sm">
<Box mt={8}>
<Alert variant="outlined" color="info" severity="info">
<AlertTitle>{t('improve-this-page')}</AlertTitle>
{githubUrl && (
<Button
href={githubUrl}
size="small"
variant="text"
target="_blank"
rel="noreferrer noopener"
startIcon={<GitHub fontSize="small" />}>
{t('github-link-text')}
</Button>
)}
{figmaUrl && (
<Button
href={figmaUrl}
size="small"
variant="text"
target="_blank"
rel="noreferrer noopener"
startIcon={<Web fontSize="small" />}>
{t('figma-link-text')}
</Button>
)}
</Alert>
</Box>
</Container>
)
}
4 changes: 1 addition & 3 deletions src/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ export default function Layout({
{title}
</Typography>
)}
{githubUrl && figmaUrl && (
<ImproveThisPageTag githubUrl={githubUrl} figmaUrl={figmaUrl} />
)}
{children}
<ImproveThisPageTag githubUrl={githubUrl} figmaUrl={figmaUrl} />
</Box>
<Snackbar />
</Container>
Expand Down

0 comments on commit 520efc2

Please sign in to comment.