Skip to content

Commit

Permalink
SDA-4434: Update Fr/Jp text
Browse files Browse the repository at this point in the history
  • Loading branch information
NguyenTranHoangSym committed Jan 3, 2024
1 parent b28e896 commit 07681f4
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 10 deletions.
6 changes: 5 additions & 1 deletion spec/__snapshots__/aboutApp.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ exports[`about app should render correctly 1`] = `
onMouseDown={[Function]}
title="Close"
>
Close
<span
className="AboutApp-button-save-restart-text"
>
Close
</span>
</button>
</div>
</div>
Expand Down
16 changes: 7 additions & 9 deletions src/renderer/components/about-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ interface IState {
updatedHostname?: string;
isPodEditing: boolean;
isValidHostname: boolean;
didUpdateHostname: boolean;
}

const ABOUT_SYMPHONY_NAMESPACE = 'AboutSymphony';
Expand Down Expand Up @@ -96,7 +95,6 @@ export default class AboutApp extends React.Component<{}, IState> {
updatedHostname: '',
isPodEditing: false,
isValidHostname: true,
didUpdateHostname: false,
};
this.updateState = this.updateState.bind(this);
}
Expand Down Expand Up @@ -222,7 +220,9 @@ export default class AboutApp extends React.Component<{}, IState> {
ref={this.closeButtonRef}
disabled={!isValidHostname}
>
{closeButtonText}
<span className='AboutApp-button-save-restart-text'>
{closeButtonText}
</span>
</button>
</div>
</div>
Expand Down Expand Up @@ -255,7 +255,7 @@ export default class AboutApp extends React.Component<{}, IState> {
*/
public copy(): void {
const { clientVersion, ...rest } = this.state;
const { isPodEditing, isValidHostname, didUpdateHostname, ...data } = {
const { isPodEditing, isValidHostname, ...data } = {
...{ sbeVersion: clientVersion },
...rest,
};
Expand All @@ -273,7 +273,7 @@ export default class AboutApp extends React.Component<{}, IState> {
* Close modal
*/
public close(): void {
const { isValidHostname, didUpdateHostname, hostname } = this.state;
const { isValidHostname } = this.state;
const finalConfig = this.state.finalConfig?.url
.replace(/https:\/\//g, '')
?.split('/')[0];
Expand All @@ -283,8 +283,8 @@ export default class AboutApp extends React.Component<{}, IState> {
const compareHostName =
finalConfig && updatedHostname && finalConfig !== updatedHostname;

if (isValidHostname && didUpdateHostname && compareHostName) {
ipcRenderer.send('user-pod-updated', hostname);
if (isValidHostname && compareHostName) {
ipcRenderer.send('user-pod-updated', this.state.updatedHostname);
}
ipcRenderer.send('close-about-app');
}
Expand All @@ -308,8 +308,6 @@ export default class AboutApp extends React.Component<{}, IState> {
if (e.detail === 3) {
this.setState({
isPodEditing: !!(this.state.globalConfig as IConfig)?.isPodUrlEditable,
didUpdateHostname: !!(this.state.globalConfig as IConfig)
?.isPodUrlEditable,
});
}
}
Expand Down
30 changes: 30 additions & 0 deletions src/renderer/styles/about-app.less
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,31 @@ body {
}
}

&-cancel-button-save-restart:lang(ja-JP) {
box-shadow: none;
border: none;
border-radius: 20px;
font-size: 0.875rem;
text-align: center;
display: inline-block;
text-decoration: none;
line-height: 12px;
background-color: @electricity-ui-50;
color: @electricity-ui-05;
cursor: pointer;
box-sizing: border-box;
text-transform: uppercase;
font-weight: 600;
width: 35%;
margin-right: 8px;
height: 36px;

&:focus {
box-shadow: 0 0 10px rgba(61, 162, 253, 1);
outline: none;
}
}

&-button-save-restart {
box-shadow: none;
border: none;
Expand All @@ -262,6 +287,11 @@ body {
}
}

&-button-save-restart-text:lang(fr-FR) {
font-size: 0.75rem;
line-height: 1rem;
}

&-button-save-restart-disabled {
box-shadow: none;
border: none;
Expand Down

0 comments on commit 07681f4

Please sign in to comment.