-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix breaks from bad merge (/revert order)
- Loading branch information
Showing
4 changed files
with
135 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,58 @@ | ||
import React from 'react' | ||
import Paper from '@material-ui/core/Paper' | ||
|
||
import styled from 'styled-components' | ||
import { Typography, useTheme } from '@material-ui/core' | ||
import { defineMessages, useIntl } from 'react-intl' | ||
import buildConfig from '../../../build-config' | ||
const m = defineMessages({ | ||
mapeoVersion: 'Mapeo Version', | ||
mapeoVariant: 'Mapeo Variant' | ||
}) | ||
export const AboutMapeoMenu = () => { | ||
return <Paper></Paper> | ||
console.log('test') | ||
const { formatMessage: t } = useIntl() | ||
return ( | ||
<Container> | ||
<KeyValuePair | ||
label={t(m.mapeoVersion)} | ||
value={buildConfig.version} | ||
></KeyValuePair> | ||
<KeyValuePair | ||
label={t(m.mapeoVariant)} | ||
value={buildConfig.variant} | ||
></KeyValuePair> | ||
</Container> | ||
) | ||
} | ||
const KeyValuePair = ({ label, value }) => { | ||
const theme = useTheme() | ||
return ( | ||
<Column> | ||
<Typography variant='body1' component='label' style={{ fontWeight: 500 }}> | ||
{label} | ||
</Typography> | ||
<Typography | ||
variant='caption' | ||
component='label' | ||
style={{ color: theme.palette.grey['700'] }} | ||
> | ||
{value} | ||
</Typography> | ||
</Column> | ||
) | ||
} | ||
const Container = styled(Paper)` | ||
width: 300px; | ||
padding: 1.2em 1em 1em 1em; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1em; | ||
&.MuiPaper-rounded { | ||
border-radius: 0; | ||
} | ||
` | ||
const Column = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.1em; | ||
` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,48 @@ | ||
import React, { useState } from 'react' | ||
import Paper from '@material-ui/core/Paper' | ||
import InfoIcon from '@material-ui/icons/Info' | ||
import InfoIcon from '@material-ui/icons/InfoOutlined' | ||
import { SettingsMenu } from './SettingsMenu' | ||
import { defineMessages } from 'react-intl' | ||
import { AboutMapeoMenu } from './AboutMapeo' | ||
import styled from 'styled-components' | ||
|
||
const m = defineMessages({ | ||
aboutMapeo: 'About Mapeo' | ||
aboutMapeo: 'About Mapeo', | ||
aboutMapeoSubtitle: 'Version and build number' | ||
}) | ||
|
||
const tabs = /** @typedef {const} */ [ | ||
{ | ||
tabId: 'AboutMapeo', | ||
icon: InfoIcon, | ||
label: m.aboutMapeo, | ||
subtitle: 'Version and build number' | ||
subtitle: m.aboutMapeoSubtitle | ||
}, | ||
{ | ||
tabId: 'TestItem', | ||
icon: InfoIcon, | ||
label: 'Test item', | ||
subtitle: 'Item added to display multiple options' | ||
} | ||
] | ||
|
||
export const SettingsView = () => { | ||
const [menuItem, setMenuItem] = useState(null) | ||
|
||
console.log({ menuItem }) | ||
const [menuItem, setMenuItem] = useState(tabs[0].tabId) | ||
|
||
return ( | ||
<div> | ||
<Container> | ||
<SettingsMenu | ||
tabs={tabs} | ||
currentTab={menuItem} | ||
onTabChange={setMenuItem} | ||
/> | ||
|
||
{menuItem === 'AboutMapeo' && ( | ||
<Paper> | ||
<AboutMapeoMenu /> | ||
</Paper> | ||
)} | ||
</div> | ||
{menuItem === 'AboutMapeo' && <AboutMapeoMenu />} | ||
</Container> | ||
) | ||
} | ||
|
||
const Container = styled.div` | ||
width: 100%; | ||
display: flex; | ||
` |