-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d001c5c
commit be9011a
Showing
25 changed files
with
453 additions
and
14 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,3 +1,4 @@ | ||
include_rules = [ | ||
"+brave/components/brave_perf_predictor/common", | ||
"+brave/components/brave_private_cdn", | ||
] |
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
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
17 changes: 17 additions & 0 deletions
17
components/brave_new_tab/resources/components/ntp_widget.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,17 @@ | ||
/* Copyright (c) 2025 The Brave Authors. All rights reserved. | ||
* 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 https://mozilla.org/MPL/2.0/. */ | ||
|
||
import { color } from '@brave/leo/tokens/css/variables' | ||
import { scoped } from '../lib/scoped_css' | ||
|
||
export const style = scoped.css` | ||
& { | ||
color: ${color.text.primary}; | ||
border-radius: 16px; | ||
background: rgba(0, 0, 0, 0.50); | ||
backdrop-filter: blur(50px); | ||
padding: 16px; | ||
} | ||
` |
20 changes: 20 additions & 0 deletions
20
components/brave_new_tab/resources/components/ntp_widget.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,20 @@ | ||
/* Copyright (c) 2024 The Brave Authors. All rights reserved. | ||
* 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 https://mozilla.org/MPL/2.0/. */ | ||
|
||
import * as React from 'react' | ||
|
||
import { style } from './ntp_widget.style' | ||
|
||
interface Props { | ||
children: React.ReactNode | ||
} | ||
|
||
export function NtpWidget(props: Props) { | ||
return ( | ||
<div {...style} data-theme='dark'> | ||
{props.children} | ||
</div> | ||
) | ||
} |
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
23 changes: 23 additions & 0 deletions
23
components/brave_new_tab/resources/components/settings/stats_panel.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,23 @@ | ||
/* Copyright (c) 2024 The Brave Authors. All rights reserved. | ||
* 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 https://mozilla.org/MPL/2.0/. */ | ||
|
||
import { scoped } from '../../lib/scoped_css' | ||
|
||
export const style = scoped.css` | ||
& { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
> * { | ||
display: flex; | ||
align-items: center; | ||
label { | ||
flex: 1 1 auto; | ||
} | ||
} | ||
} | ||
` |
32 changes: 32 additions & 0 deletions
32
components/brave_new_tab/resources/components/settings/stats_panel.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,32 @@ | ||
/* Copyright (c) 2024 The Brave Authors. All rights reserved. | ||
* 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 https://mozilla.org/MPL/2.0/. */ | ||
|
||
import * as React from 'react' | ||
import Toggle from '@brave/leo/react/toggle' | ||
|
||
import { useLocale } from '../locale_context' | ||
import { useNewTabModel, useNewTabState } from '../new_tab_context' | ||
|
||
import { style } from './stats_panel.style' | ||
|
||
export function StatsPanel() { | ||
const { getString } = useLocale() | ||
const model = useNewTabModel() | ||
|
||
const showStats = useNewTabState((state) => state.showShieldsStats) | ||
|
||
return ( | ||
<div {...style}> | ||
<div className='form-control-row'> | ||
<label>{getString('showStatsLabel')}</label> | ||
<Toggle | ||
size='small' | ||
checked={showStats} | ||
onChange={({ checked }) => { model.setShowShieldsStats(checked) }} | ||
/> | ||
</div> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.