Skip to content

Commit

Permalink
Feat: import/export in the Safe List sidebar (#2299)
Browse files Browse the repository at this point in the history
* Feat: import/export in the Safe List sidebar

* Adjust style
  • Loading branch information
katspaugh authored Aug 14, 2023
1 parent 669e293 commit ba62ea1
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/components/settings/DataManagement/ImportFileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const ImportFileUpload = ({

return (
<>
<Typography>Import {'Safe{Wallet}'} data by clicking or dragging a file below.</Typography>
<Typography>Import {'Safe{Wallet}'} data by uploading a file in the area below.</Typography>

<FileUpload
fileType={FileTypes.JSON}
Expand All @@ -74,7 +74,7 @@ export const ImportFileUpload = ({
mr: 0.5,
}}
/>
Only JSON files exported from a {'Safe{Wallet}'} can be imported.
Only JSON files exported from the {'Safe{Wallet}'} can be imported.
</Typography>
</>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/SafeList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const SafeList = ({ closeDrawer }: { closeDrawer?: () => void }): ReactElement =
)

return (
<div className={css.container}>
<div>
<div className={css.header}>
<Typography variant="h4" display="inline" fontWeight={700}>
My Safe Accounts
Expand Down
4 changes: 0 additions & 4 deletions src/components/sidebar/SafeList/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.container {
overflow-y: auto;
}

.header {
display: flex;
justify-content: space-between;
Expand Down
5 changes: 5 additions & 0 deletions src/components/sidebar/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import SidebarFooter from '@/components/sidebar/SidebarFooter'

import css from './styles.module.css'
import { trackEvent, OVERVIEW_EVENTS } from '@/services/analytics'
import { DataWidget } from '@/components/welcome/DataWidget'

const Sidebar = (): ReactElement => {
const [isDrawerOpen, setIsDrawerOpen] = useState<boolean>(false)
Expand Down Expand Up @@ -53,6 +54,10 @@ const Sidebar = (): ReactElement => {
<Drawer variant="temporary" anchor="left" open={isDrawerOpen} onClose={onDrawerToggle}>
<div className={css.drawer}>
<SafeList closeDrawer={closeDrawer} />

<div className={css.dataWidget}>
<DataWidget />
</div>
</div>
</Drawer>
</div>
Expand Down
14 changes: 8 additions & 6 deletions src/components/sidebar/Sidebar/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.container,
.drawer {
.container {
height: 100vh;
padding-top: var(--header-height);
display: flex;
Expand All @@ -25,12 +24,15 @@
.drawer {
width: 480px;
max-width: 90vw;
padding-top: var(--header-height);
border-right: 1px solid var(--color-border-light);
overflow-y: auto;
height: 100%;
}

.drawer {
text-align: center;
padding: var(--header-height) 0 0 0;
border-right: 1px solid var(--color-border-light);
.dataWidget {
margin-top: var(--space-4);
border-top: 1px solid var(--color-border-light);
}

.noSafeHeader {
Expand Down
1 change: 1 addition & 0 deletions src/components/welcome/DataWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const DataWidget = (): ReactElement => {
<SvgIcon component={FileIcon} inheritViewBox fontSize="small" sx={{ fill: 'none' }} />
</Box>
}
className={css.cardHeader}
title={<b>{hasData ? 'Work with your data' : 'Already have a Safe Account?'}</b>}
subheader={hasData ? 'Export or import your data' : 'Import your data'}
/>
Expand Down
4 changes: 4 additions & 0 deletions src/components/welcome/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
padding: 0;
}

.cardHeader {
text-align: left;
}

@media (max-width: 899.95px) {
.sidebar :global .MuiPaper-root {
height: 100%;
Expand Down

0 comments on commit ba62ea1

Please sign in to comment.