-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #781 from CodeForAfrica/ft/hurumap-location-highlight
HURUmap Location Highlight
- Loading branch information
Showing
16 changed files
with
134 additions
and
220 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
58 changes: 0 additions & 58 deletions
58
apps/climatemappedafrica/src/components/HURUmap/LocationHighlight/index.js
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
apps/climatemappedafrica/src/components/HURUmap/LocationHighlight/index.stories.js
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
apps/climatemappedafrica/src/components/HURUmap/LocationHighlight/useStyles.js
This file was deleted.
Oops, something went wrong.
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
58 changes: 0 additions & 58 deletions
58
apps/pesayetu/src/components/HURUmap/LocationHighlight/index.js
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
apps/pesayetu/src/components/HURUmap/LocationHighlight/index.stories.js
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
apps/pesayetu/src/components/HURUmap/LocationHighlight/useStyles.js
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
apps/uibook/stories/HURUmap/core/LocationHighlight.stories.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,39 @@ | ||
import { LocationHighlight } from "@hurumap/core"; | ||
import React from "react"; | ||
|
||
const highlights = [ | ||
{ | ||
title: "Population", | ||
value: "1,000,000", | ||
}, | ||
{ | ||
title: "GDP", | ||
value: "1,000,000", | ||
}, | ||
{ | ||
title: "Area", | ||
value: "1,000,000", | ||
}, | ||
]; | ||
|
||
export default { | ||
title: "@hurumap/core/LocationHighlight", | ||
argTypes: { | ||
isLoading: { | ||
control: { | ||
type: "boolean", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
function Template({ ...args }) { | ||
return <LocationHighlight {...args} />; | ||
} | ||
|
||
export const Default = Template.bind({}); | ||
|
||
Default.args = { | ||
isLoading: false, | ||
...highlights[0], | ||
}; |
44 changes: 44 additions & 0 deletions
44
packages/hurumap-core/src/LocationHighlight/LocationHighlight.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,44 @@ | ||
import { Box, Typography } from "@mui/material"; | ||
import React from "react"; | ||
|
||
const LocationHighlight = React.forwardRef(function LocationHighlight( | ||
{ | ||
TitleTypographyProps, | ||
ValueTypographyProps, | ||
title, | ||
value, | ||
isLoading, | ||
...props | ||
}, | ||
ref, | ||
) { | ||
return ( | ||
<Box | ||
alignItems="center" | ||
display="inline-flex" | ||
flexDirection="column" | ||
flexGrow={1} | ||
ref={ref} | ||
{...props} | ||
> | ||
<Typography | ||
variant="subtitle1" | ||
{...TitleTypographyProps} | ||
sx={(theme) => ({ | ||
fontSize: theme.typography.pxToRem(10), | ||
fontWeight: 300, | ||
lineHeight: 24 / 10, | ||
textTransform: "uppercase", | ||
...TitleTypographyProps?.sx, | ||
})} | ||
> | ||
{title} | ||
</Typography> | ||
<Typography variant="body2" {...ValueTypographyProps}> | ||
{isLoading ? "…" : value} | ||
</Typography> | ||
</Box> | ||
); | ||
}); | ||
|
||
export default LocationHighlight; |
20 changes: 20 additions & 0 deletions
20
packages/hurumap-core/src/LocationHighlight/LocationHighlight.snap.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,20 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`LocationHighlight renders unchanged 1`] = ` | ||
<div> | ||
<div | ||
class="MuiBox-root css-1s0xv82" | ||
> | ||
<h6 | ||
class="MuiTypography-root MuiTypography-subtitle1 css-luofes-MuiTypography-root" | ||
> | ||
Population | ||
</h6> | ||
<p | ||
class="MuiTypography-root MuiTypography-body2 css-e784if-MuiTypography-root" | ||
> | ||
1,000,000 | ||
</p> | ||
</div> | ||
</div> | ||
`; |
Oops, something went wrong.