Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
update DisabledContentView to support reporting broken sites
Browse files Browse the repository at this point in the history
  • Loading branch information
antonok-edm committed Sep 12, 2019
1 parent 0ca5339 commit 5bb4894
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/features/shields/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export const DisabledContentText = styled<{}, 'div'>('div')`
font-size: 12px;
font-weight: normal;
line-height: 18px;
text-align: center;
`

/**
Expand Down
11 changes: 6 additions & 5 deletions src/features/shields/structure/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,12 @@ export const BlockedListFooterWithOptions = styled<{}, 'footer'>('footer')`
export const DisabledContentView = styled<{}, 'section'>('section')`
box-sizing: border-box;
display: grid;
grid-template-columns: 2fr 5fr;
grid-gap: 4px;
align-items: center;
max-width: 80%;
margin: 5px auto 8px;
grid-template-rows: auto auto;
flex-direction: column;
grid-gap: 12px;
justify-items: center;
max-width: 70%;
margin: 10px auto -5px;
`

/**
Expand Down
5 changes: 4 additions & 1 deletion src/theme/brave-dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const darkTheme: ITheme = {
color: {
...defaultTheme.color,
contextMenuBackground: colors.black,
contextMenuForeground: colors.white
contextMenuForeground: colors.white,
defaultControl: colors.grey400,
defaultControlInteracting: colors.white,
defaultControlActive: colors.grey500,
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/theme/shields-dark.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import ITheme from './theme-interface'
import defaultTheme from './brave-default'
import darkTheme from './brave-dark'
import colors from './colors'

const shieldsDarkTheme: ITheme = {
...defaultTheme,
...darkTheme,
name: 'Shields Dark',
color: {
...defaultTheme.color,
...darkTheme.color,
lionLogo: colors.grey700,
text: colors.white,
panelBackground: '#17171F',
Expand Down
4 changes: 2 additions & 2 deletions stories/features/shields/components/advancedView/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
TotalBlockedStatsNumber,
TotalBlockedStatsText,
DisabledContentView,
ShieldIcon,
ShieldsButton,
DisabledContentText,
Toggle
} from '../../../../../src/features/shields'
Expand Down Expand Up @@ -108,8 +108,8 @@ export default class Header extends React.PureComponent<Props, {}> {
)
: (
<DisabledContentView>
<div><ShieldIcon /></div>
<DisabledContentText>{getLocale('disabledMessage')}</DisabledContentText>
<ShieldsButton level='secondary' type='default' size='small' onClick={() => {}} text={getLocale('reportBrokenSite')}/>
</DisabledContentView>
)
}
Expand Down
4 changes: 2 additions & 2 deletions stories/features/shields/components/simpleView/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
TotalBlockedStatsNumber,
TotalBlockedStatsText,
DisabledContentView,
ShieldIcon,
ShieldsButton,
DisabledContentText,
Toggle
} from '../../../../../src/features/shields'
Expand Down Expand Up @@ -93,8 +93,8 @@ export default class Header extends React.PureComponent<Props, {}> {
)
: (
<DisabledContentView>
<div><ShieldIcon /></div>
<DisabledContentText>{getLocale('disabledMessage')}</DisabledContentText>
<ShieldsButton level='secondary' type='default' size='small' onClick={() => {}} text={getLocale('reportBrokenSite')}/>
</DisabledContentView>
)
}
Expand Down
3 changes: 2 additions & 1 deletion stories/features/shields/fakeLocale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const locale: { [key: string]: string } = {
down: 'down',
forThisSite: 'for this site',
enabledMessage: 'If a site appears broken, try shields down',
disabledMessage: 'You’re browsing this site without any privacy and security protections.',
disabledMessage: 'You’re browsing this site without Brave\'s privacy and security protections. Does it not work right with Shields up?',
reportBrokenSite: 'Report a broken site',
// Total stats blocked
itemsBlocked: 'Items blocked',
itemBlocked: 'Item blocked',
Expand Down

0 comments on commit 5bb4894

Please sign in to comment.