Skip to content

Commit

Permalink
Sync device name should have restricted length
Browse files Browse the repository at this point in the history
  • Loading branch information
cezaraugusto committed Nov 19, 2018
1 parent b434225 commit 7a18d97
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
30 changes: 14 additions & 16 deletions components/brave_sync/ui/components/enabledContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import {
SwitchLabel,
Paragraph,
SectionBlock,
SubTitle
SubTitle,
TableRowId,
TableRowDevice,
TableRowRemove,
TableRowRemoveButton
} from 'brave-ui/features/sync'

// Modals
Expand Down Expand Up @@ -52,21 +56,15 @@ class SyncEnabledContent extends React.PureComponent<SyncEnabledContentProps, Sy
return devices.map((device: any): Row => {
const cell: Row = {
content: [
{ content: device.id },
{ content: device.name },
{ content: <TableRowId>{device.id}</TableRowId> },
{ content: <TableRowDevice>{device.name}</TableRowDevice> },
{ content: device.lastActive },
{
content: (
<span
style={{ cursor: 'pointer' /* TODO: cezar make this a component */ }}
data-id={device.id}
data-name={device.name}
onClick={this.onRemoveDevice}
>
&times;
</span>
),
customStyle: { 'text-align': 'center' }
<TableRowRemoveButton data-id={device.id} data-name={device.name} onClick={this.onRemoveDevice}>
&times;
</TableRowRemoveButton>
)
}
]
}
Expand All @@ -76,10 +74,10 @@ class SyncEnabledContent extends React.PureComponent<SyncEnabledContentProps, Sy

get header (): Cell[] {
return [
{ content: getLocale('id') },
{ content: getLocale('deviceName') },
{ content: <TableRowId>{getLocale('id')}</TableRowId> },
{ content: <TableRowDevice>{getLocale('deviceName')}</TableRowDevice> },
{ content: getLocale('lastActive') },
{ content: getLocale('removeDevice'), customStyle: { 'text-align': 'center' } }
{ content: <TableRowRemove>{getLocale('removeDevice')}</TableRowRemove> }
]
}

Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
"babel-preset-react": "^6.24.1",
"babel-preset-react-optimize": "^1.0.1",
"babel-preset-stage-0": "^6.24.1",
"brave-ui": "^0.34.1",
"brave-ui": "^0.34.2",
"css-loader": "^0.28.9",
"csstype": "^2.5.5",
"emptykit.css": "^1.0.1",
Expand Down

0 comments on commit 7a18d97

Please sign in to comment.