Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
konradkalemba committed Mar 26, 2020
1 parent 5ea29fb commit 2b99174
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 115 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ yarn-error.log*

# IntellJ / Webstorm
/.idea

# VS Code
.vscode
28 changes: 14 additions & 14 deletions src/components/Common/ResponsiveTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import React from 'react';
import { Tab } from 'baseui/tabs';

export default function ResponsiveTab(props) {
return (
<Tab
overrides={{
Tab: {
style: {
flexGrow: 1,
textAlign: 'center'
},
},
}}
{...props}
/>
);
}
return (
<Tab
overrides={{
Tab: {
style: {
flexGrow: 1,
textAlign: 'center',
},
},
}}
{...props}
/>
);
}
192 changes: 96 additions & 96 deletions src/components/DailyGrowth/DailyGrowth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function accumulateData(data) {
[DEATHS_KEY]: cumulativeDeaths,
[DAILY_DEATH_KEY]: deathsDateCount,
[CURES_KEY]: cumulativeCures,
[DAILY_CURES_KEY]: curesDateCount
[DAILY_CURES_KEY]: curesDateCount,
};
});
}
Expand All @@ -54,7 +54,7 @@ export default function DailyGrowth() {

const { t } = useTranslation();
const [groupedData, setGroupedData] = useState(null);
const [activeKey, setActiveKey] = useState("0");
const [activeKey, setActiveKey] = useState('0');
const [, theme] = useStyletron();

useEffect(() => {
Expand All @@ -76,100 +76,100 @@ export default function DailyGrowth() {
{isLoading ? (
<Loader />
) : (
<Tabs
onChange={({ activeKey }) => {
setActiveKey(activeKey);
}}
activeKey={activeKey}
>
<ResponsiveTab title={t('casesOverall')}>
<StyledBody>
<Block
$style={{
margin: '12px 0 20px',
}}
/>
<ResponsiveContainer height={180}>
<LineChart data={groupedData}>
<XAxis dataKey='date' />
<YAxis hide={true} />
<Tooltip
contentStyle={{
backgroundColor: theme.colors.backgroundPrimary,
borderColor: theme.colors.backgroundTertiary,
}}
cursor={{ fill: theme.colors.backgroundTertiary }}
/>
<Line
name={t('confirmedCasesShort')}
type='monotone'
dataKey={CASES_KEY}
strokeWidth={2}
stroke={theme.colors.negative}
dot={false}
/>
<Line
name={t('deaths')}
type='monotone'
dataKey={DEATHS_KEY}
strokeWidth={2}
stroke={theme.colors.primary}
dot={false}
/>
<Line
name={t('cured')}
type='monotone'
dataKey={CURES_KEY}
strokeWidth={2}
stroke={theme.colors.positive}
dot={false}
/>
</LineChart>
</ResponsiveContainer>
</StyledBody>
</ResponsiveTab>
<ResponsiveTab title={t('casesDaily')}>
<StyledBody>
<Block
$style={{
margin: '12px 0 20px',
}}
/>
<ResponsiveContainer height={180}>
<BarChart data={groupedData}>
<XAxis dataKey="date" />
<YAxis hide={true} />
<Tooltip
contentStyle={{
backgroundColor: theme.colors.backgroundPrimary,
borderColor: theme.colors.backgroundTertiary
}}
cursor={{ fill: theme.colors.backgroundTertiary }}
/>
<Bar
name={t('confirmedCasesShort')}
stackId={STACK_PER_DATE_ID}
dataKey={DAILY_CASES_KEY}
fill={theme.colors.negative}
/>
<Bar
name={t('deaths')}
stackId={STACK_PER_DATE_ID}
dataKey={DAILY_DEATH_KEY}
fill={theme.colors.primary}
/>
<Bar
name={t('cured')}
stackId={STACK_PER_DATE_ID}
dataKey={DAILY_CURES_KEY}
fill={theme.colors.positive}
/>
</BarChart>
</ResponsiveContainer>
</StyledBody>
</ResponsiveTab>
</Tabs>
)}
<Tabs
onChange={({ activeKey }) => {
setActiveKey(activeKey);
}}
activeKey={activeKey}
>
<ResponsiveTab title={t('casesOverall')}>
<StyledBody>
<Block
$style={{
margin: '12px 0 20px',
}}
/>
<ResponsiveContainer height={180}>
<LineChart data={groupedData}>
<XAxis dataKey='date' />
<YAxis hide={true} />
<Tooltip
contentStyle={{
backgroundColor: theme.colors.backgroundPrimary,
borderColor: theme.colors.backgroundTertiary,
}}
cursor={{ fill: theme.colors.backgroundTertiary }}
/>
<Line
name={t('confirmedCasesShort')}
type='monotone'
dataKey={CASES_KEY}
strokeWidth={2}
stroke={theme.colors.negative}
dot={false}
/>
<Line
name={t('deaths')}
type='monotone'
dataKey={DEATHS_KEY}
strokeWidth={2}
stroke={theme.colors.primary}
dot={false}
/>
<Line
name={t('cured')}
type='monotone'
dataKey={CURES_KEY}
strokeWidth={2}
stroke={theme.colors.positive}
dot={false}
/>
</LineChart>
</ResponsiveContainer>
</StyledBody>
</ResponsiveTab>
<ResponsiveTab title={t('casesDaily')}>
<StyledBody>
<Block
$style={{
margin: '12px 0 20px',
}}
/>
<ResponsiveContainer height={180}>
<BarChart data={groupedData}>
<XAxis dataKey='date' />
<YAxis hide={true} />
<Tooltip
contentStyle={{
backgroundColor: theme.colors.backgroundPrimary,
borderColor: theme.colors.backgroundTertiary,
}}
cursor={{ fill: theme.colors.backgroundTertiary }}
/>
<Bar
name={t('confirmedCasesShort')}
stackId={STACK_PER_DATE_ID}
dataKey={DAILY_CASES_KEY}
fill={theme.colors.negative}
/>
<Bar
name={t('deaths')}
stackId={STACK_PER_DATE_ID}
dataKey={DAILY_DEATH_KEY}
fill={theme.colors.primary}
/>
<Bar
name={t('cured')}
stackId={STACK_PER_DATE_ID}
dataKey={DAILY_CURES_KEY}
fill={theme.colors.positive}
/>
</BarChart>
</ResponsiveContainer>
</StyledBody>
</ResponsiveTab>
</Tabs>
)}
</StyledCard>
);
}
2 changes: 1 addition & 1 deletion src/components/DataElement/DataElement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function DataElement() {
textAlign: 'left',
padding: '14px',
},
}
},
}}
>
<ResponsiveTab title={t('confirmedCases')}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Layout/Mobile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const FlexGridItemCentered = ({ children }) => {
display: 'flex',
width: '100%',
padding: '10px',
justifyContent: 'center'
justifyContent: 'center',
})}
>
{children}
Expand Down Expand Up @@ -66,7 +66,7 @@ export default function Mobile() {
<div
className={css({
display: 'flex',
justifyContent: 'space-around'
justifyContent: 'space-around',
})}
>
<FlexGridItemCentered>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"contact": "Contact",
"openSourceApp": "The application is 'open-source' - anyone willing can directly help in the development of the project. Source code can be found at the following link:",
"contributors": "Contributors",
"casesOverall" : "Overall",
"casesOverall": "Overall",
"casesDaily": "Daily",
"curedInfo": "The daily number of healed was corrected after misinterpreting the GIS message, which spoke of 13 healers.",
"loadingData": "Loading data",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"contact": "Kontakt",
"openSourceApp": "Aplikacja jest 'open-source' — każdy chętny może bezpośrednio pomóc w rozwoju projektu. Kod źródłowy znajduje się pod poniższym odnośnikiem:",
"contributors": "Współtwórcy",
"casesOverall" : "Wszystkie",
"casesOverall": "Wszystkie",
"casesDaily": "Dzienne",
"curedInfo": "Liczba wyleczonych została skorygowana po błędnej interpretacji komunikatu GIS-u, który mówił o 13 ozdrowiałych.",
"loadingData": "Ładowanie danych",
Expand Down

0 comments on commit 2b99174

Please sign in to comment.