-
Notifications
You must be signed in to change notification settings - Fork 894
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves brave/brave-browser#10318 - NTP Widget Settings design updates
- Loading branch information
Showing
26 changed files
with
383 additions
and
93 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
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
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
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
16 changes: 16 additions & 0 deletions
16
components/brave_new_tab_ui/components/default/addCard/assets/add-icon.tsx
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,16 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import * as React from 'react' | ||
|
||
export default class AddIcon extends React.PureComponent { | ||
|
||
render () { | ||
return ( | ||
<svg width={'17'} height={'18'} viewBox={'0 0 17 18'} fill={'none'} xmlns={'http://www.w3.org/2000/svg'}> | ||
<path fillRule={'evenodd'} clipRule={'evenodd'} d={'M15.9722 9.69428H9.02778V16.6387C9.02778 17.0221 8.71667 17.3332 8.33333 17.3332C7.95 17.3332 7.63889 17.0221 7.63889 16.6387V9.69428H0.694444C0.311111 9.69428 0 9.38317 0 8.99984C0 8.6165 0.311111 8.30539 0.694444 8.30539H7.63889V1.36095C7.63889 0.977615 7.95 0.666504 8.33333 0.666504C8.71667 0.666504 9.02778 0.977615 9.02778 1.36095V8.30539H15.9722C16.3556 8.30539 16.6667 8.6165 16.6667 8.99984C16.6667 9.38317 16.3556 9.69428 15.9722 9.69428Z'} fill={'#F0F2FF'}/> | ||
</svg> | ||
) | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
components/brave_new_tab_ui/components/default/addCard/index.tsx
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 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import * as React from 'react' | ||
import createWidget from '../widget/index' | ||
import { getLocale } from '../../../../common/locale' | ||
|
||
// Components | ||
import { StyledTitleTab } from '../widgetTitleTab' | ||
import { | ||
Header, | ||
StyledTitle, | ||
StyledAddIcon | ||
} from './style' | ||
import AddCardIcon from './assets/add-icon' | ||
|
||
interface Props { | ||
onAddCard: () => void | ||
} | ||
|
||
class AddCard extends React.PureComponent<Props, {}> { | ||
|
||
render () { | ||
const { onAddCard } = this.props | ||
|
||
return ( | ||
<StyledTitleTab onClick={onAddCard}> | ||
<Header> | ||
<StyledTitle> | ||
<StyledAddIcon> | ||
<AddCardIcon /> | ||
</StyledAddIcon> | ||
<> | ||
{getLocale('addCardWidgetTitle')} | ||
</> | ||
</StyledTitle> | ||
</Header> | ||
</StyledTitleTab> | ||
) | ||
} | ||
} | ||
|
||
export const AddCardWidget = createWidget(AddCard) |
29 changes: 29 additions & 0 deletions
29
components/brave_new_tab_ui/components/default/addCard/style.ts
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,29 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License. v. 2.0. If a copy of the MPL was not distributed with this file. | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import styled from 'brave-ui/theme' | ||
import palette from 'brave-ui/theme/colors' | ||
|
||
export const Header = styled<{}, 'div'>('div')` | ||
text-align: left; | ||
` | ||
|
||
export const StyledTitle = styled<{}, 'div'>('div')` | ||
margin-top: 6px; | ||
display: flex; | ||
justify-content: flex-start; | ||
align-items: center; | ||
font-size: 18px; | ||
font-weight: 600; | ||
color: ${palette.white}; | ||
font-family: ${p => p.theme.fontFamily.heading}; | ||
` | ||
|
||
export const StyledAddIcon = styled<{}, 'div'>('div')` | ||
width: 24px; | ||
height: 24px; | ||
margin-right: 7px; | ||
margin-left: 5px; | ||
margin-top: 2px; | ||
` |
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
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
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.