-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating Bookmarks Toggle and Splitting Account Page
- Loading branch information
Showing
9 changed files
with
255 additions
and
38 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,82 @@ | ||
import React, { useState } from 'react' | ||
import { makeStyles } from '@material-ui/core/styles' | ||
import Button from '@material-ui/core/Button' | ||
import PropTypes from 'prop-types' | ||
import { Backdrop, Typography } from '@material-ui/core' | ||
import TextField from '@material-ui/core/TextField' | ||
import Notification from './Notification' | ||
import shortcutImage from 'src/assets/images/shortcut.png' | ||
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline' | ||
import SearchInput from 'src/components/SearchInput' | ||
import Alert from '@material-ui/lab/Alert' | ||
import InfoIcon from '@material-ui/icons/InfoOutlined' | ||
import Logo from 'src/components/Logo' | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
content: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
color: 'white' | ||
}, | ||
shortcut: { | ||
width: '300px', | ||
}, | ||
addIcon: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
alignItems: 'center' | ||
}, | ||
circle: { | ||
height: '48px', | ||
width: '48px' | ||
}, | ||
white: { | ||
color: 'white', | ||
borderColor: 'white' | ||
} | ||
})) | ||
const AddShortcutPage = ({app, user}) => { | ||
const classes = useStyles() | ||
const onSettingsClick = () => { | ||
|
||
} | ||
|
||
return ( | ||
<Backdrop open={true}> | ||
<Logo style={{ height: 40 }} color='white'/> | ||
<div className={classes.content}> | ||
<SearchInput app={app} user={user} /> | ||
<div className={classes.addIcon}> | ||
<AddCircleOutlineIcon className={classes.circle}/> | ||
<Typography>Add Shortcut</Typography> | ||
</div> | ||
<img src={shortcutImage} alt="shortcut" className={classes.shortcut} /> | ||
<Typography>Add more shortcuts and they’ll appear here!</Typography> | ||
<Alert icon={<InfoIcon className={classes.white} />} severity="info" variant="outlined" className={classes.white}> | ||
Don't want shortcuts? You can hide them from your settings page. | ||
<Button | ||
className={classes.white} | ||
onClick={onSettingsClick} | ||
> | ||
Settings | ||
</Button> | ||
</Alert> | ||
</div> | ||
</Backdrop> | ||
) | ||
} | ||
|
||
AddShortcutPage.propTypes = { | ||
onCancel: PropTypes.func, | ||
onSave: PropTypes.func, | ||
} | ||
|
||
AddShortcutPage.defaultProps = { | ||
onCancel: () => {}, | ||
onSave: () => {}, | ||
} | ||
|
||
export default AddShortcutPage |
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,77 @@ | ||
import React from 'react' | ||
import { makeStyles } from '@material-ui/core/styles' | ||
import AddShortcutPage from './AddShortcutPage' | ||
|
||
export default { | ||
title: 'Components/AddShortcutPage', | ||
component: AddShortcutPage, | ||
parameters: { | ||
backgrounds: { | ||
default: 'grey', | ||
values: [ | ||
{ name: 'grey', value: '#F2F2F2' }, | ||
{ name: 'black', value: '#000000' }, | ||
], | ||
}, | ||
}, | ||
} | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
widthDiv: { | ||
width: theme.spacing(150), | ||
}, | ||
})) | ||
|
||
const Template = (args) => { | ||
const classes = useStyles() | ||
return ( | ||
<div className={classes.widthDiv}> | ||
<AddShortcutPage {...args} /> | ||
</div> | ||
) | ||
} | ||
|
||
export const basic = Template.bind({}) | ||
basic.args = { | ||
app: { | ||
searchEngines: { | ||
edges: [ | ||
{ | ||
node: { | ||
name: 'DuckDuckGo', | ||
engineId: 'DuckDuckGo', | ||
rank: 3, | ||
isCharitable: false, | ||
inputPrompt: 'Search DuckDuckGo', | ||
}, | ||
}, | ||
{ | ||
node: { | ||
name: 'Google', | ||
engineId: 'Google', | ||
rank: 1, | ||
isCharitable: false, | ||
inputPrompt: 'Search Google', | ||
}, | ||
}, | ||
{ | ||
node: { | ||
name: 'Ecosia', | ||
engineId: 'Ecosia', | ||
rank: 2, | ||
isCharitable: false, | ||
inputPrompt: 'Search Ecosia', | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
user: { | ||
searchEngine: { | ||
name: 'Google', | ||
engineId: 'Google', | ||
inputPrompt: 'Search Google', | ||
}, | ||
yahooPaidSearchRewardOptIn: false, | ||
}, | ||
} |
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
Oops, something went wrong.