Skip to content

Commit f7bc606

Browse files
committed
feat: Add a country profile selector
1 parent 2b1c057 commit f7bc606

File tree

15 files changed

+82
-18
lines changed

15 files changed

+82
-18
lines changed

components/common/layout/articletext/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import PropTypes from 'prop-types'
22
import Box from '@mui/material/Box'
3-
import Typography from '@mui/material/typography'
3+
import Typography from '@mui/material/Typography'
44
import FullBox from '@/components/common/layout/fullbox'
55

66
function ArticleText ({

components/common/layout/subtcontenttext/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import PropTypes from 'prop-types'
22
import Box from '@mui/material/Box'
3-
import Typography from '@mui/material/typography'
3+
import Typography from '@mui/material/Typography'
44
import FullBox from '@/components/common/layout/fullbox'
55
import styles from './styles'
66

components/countries/index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import Container from '@mui/material/Container'
2+
import Typography from '@mui/material/Typography'
3+
import CountryList from '@/domain/profile/countrylist'
4+
5+
function CountriesComponent ({
6+
countries,
7+
handleSelectCountry
8+
}) {
9+
return (
10+
<Container maxWidth='lg' sx={{ margin: 'auto', textAlign: 'center' }}>
11+
<Typography variant='h3'>
12+
Country Profile
13+
</Typography>
14+
<Typography variant='h5' sx={{ marginBottom: '48px' }}>
15+
Select a country to view its profile
16+
</Typography>
17+
18+
<CountryList
19+
countries={countries}
20+
handleSelectCountry={handleSelectCountry}
21+
/>
22+
</Container>
23+
)
24+
}
25+
26+
export default CountriesComponent

components/profile-centered/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Container from '@mui/material/Container'
22
import Grid from '@mui/material/Grid'
3-
import Typography from '@mui/material/typography'
3+
import Typography from '@mui/material/Typography'
44
import SubContentText from '@/components/common/layout/subtcontenttext'
55
import DonutChart from '@/components/common/ui/charts/donut'
66
import BarChart from '@/components/common/ui/charts/bar'

components/profile/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Grid from '@mui/material/Grid'
2-
import Typography from '@mui/material/typography'
2+
import Typography from '@mui/material/Typography'
33
import SubContentText from '@/components/common/layout/subtcontenttext'
44
import DonutChart from '@/components/common/ui/charts/donut'
55
import BarChart from '@/components/common/ui/charts/bar'

components/profiletabs/index.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { useState } from 'react'
2+
import Link from 'next/link'
23
import Button from '@mui/material/Button'
34
import Box from '@mui/material/Box'
45
import Container from '@mui/material/Container'
56
import Grid from '@mui/material/Grid'
6-
import Typography from '@mui/material/typography'
7+
import Typography from '@mui/material/Typography'
78

89
import NavigationTabs from '@/domain/profiletabs/navigationtabs'
910
import TabPanel from '@/domain/profiletabs/tabpanel'
@@ -16,7 +17,7 @@ import ArticleText from '@/components/common/layout/articletext'
1617
import styles from './styles'
1718

1819
function ProfileTabsComponent ({
19-
// country,
20+
country,
2021
// countries,
2122
textData,
2223
donutData,
@@ -33,16 +34,18 @@ function ProfileTabsComponent ({
3334
<Box sx={styles.headerTitle}>
3435
<Box>
3536
<Typography variant='h1'>
36-
Pakistan
37+
{country}
3738
</Typography>
3839
<Typography variant='h4'>
3940
Country Profile
4041
</Typography>
4142
</Box>
4243

43-
<Button variant='outlined'>
44-
Countries
45-
</Button>
44+
<Link href='/countries' passHref>
45+
<Button variant='outlined'>
46+
Countries
47+
</Button>
48+
</Link>
4649
</Box>
4750

4851
<NavigationTabs

components/profiletabs/styles.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ const styles = {
2323
display: 'flex',
2424
justifyContent: 'space-between',
2525
alignItems: 'center',
26-
2726
'& button': {
2827
height: '50px',
2928
backgroundColor: theme => theme.palette.primary.light,
3029
'&:hover': {
3130
backgroundColor: '#fff'
3231
}
32+
},
33+
'& a': {
34+
textDecoration: 'none'
3335
}
3436
}
3537
}

domain/profile/countrybutton/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Button from '@mui/material/Button'
22
import { styled } from '@mui/material/styles'
33

44
const CountryButton = styled((props) => (
5-
<Button {...props} />
5+
<Button {...props} color='tertiary' />
66
/* eslint-disable no-unused-vars */
77
))(({ theme }) => ({
88
width: '150px'

domain/profiletabs/sections/climatechange/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Grid from '@mui/material/Grid'
22
import LineGraph from '@/components/common/ui/charts/line'
3-
import Typography from '@mui/material/typography'
3+
import Typography from '@mui/material/Typography'
44
import SubContentText from '@/components/common/layout/subtcontenttext'
55

66
function ClimateChange ({ barData, textData }) {

domain/profiletabs/sections/climaterisks/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Grid from '@mui/material/Grid'
22
import BarChart from '@/components/common/ui/charts/bar'
3-
import Typography from '@mui/material/typography'
3+
import Typography from '@mui/material/Typography'
44
import SubContentText from '@/components/common/layout/subtcontenttext'
55

66
function ClimateRisks ({ barData, textData }) {

0 commit comments

Comments
 (0)