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

Commit 987abd1

Browse files
authored
Merge pull request #188 from sanjam-deriv/managetokensdesign
2 parents 52f3dd8 + 3a7afde commit 987abd1

File tree

8 files changed

+41
-39
lines changed

8 files changed

+41
-39
lines changed

src/features/dashboard/components/ApiTokenCard/api-token.card.module.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@
1919
font-size: var(--fontSizes-2xs);
2020
}
2121

22+
.description {
23+
padding-right: rem(1);
24+
}
25+
2226
.warning_container {
2327
display: flex;
2428
gap: rem(1);
25-
background-color : #FFAD3A29;
29+
background-color: #ffad3a29;
2630
padding: rem(0.8);
2731
font-size: var(--fontSizes-2xs);
2832
img {

src/features/dashboard/components/ApiTokenCard/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ const ApiTokenCard = ({ register, name, label, description, ...rest }: IApiToken
1919
<div className={styles.api_token_card_input}>
2020
<CustomCheckbox name={name} id={`${name}-scope`} register={register(name)}>
2121
<label data-testid={`card-label-${name}`} htmlFor={`${name}-scope`}>
22-
<b>{label}</b>
22+
<b> {label} </b>
2323
</label>
2424
</CustomCheckbox>
2525
</div>
26-
<Text role={'definition'} as={'p'} type={'small'}>
26+
<Text role={'definition'} as={'p'} type={'small'} className={styles.description}>
2727
{description}
2828
</Text>
2929
<React.Fragment>

src/features/dashboard/components/ApiTokenTable/DeleteTokenDialog/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ const DeleteTokenDialog = ({ onDelete, setToggleModal }: TDeleteTokendialog) =>
2121
() => [
2222
{
2323
id: 0,
24-
text: 'Yes, delete',
25-
color: 'primary',
24+
text: 'Cancel',
25+
color: 'secondary',
2626
onClick: () => {
2727
setToggleModal(false);
28-
onDelete();
2928
},
3029
},
3130
{
3231
id: 1,
33-
text: 'No, keep it',
34-
color: 'secondary',
32+
text: 'Yes, delete',
33+
color: 'primary',
3534
onClick: () => {
3635
setToggleModal(false);
36+
onDelete();
3737
},
3838
},
3939
],
@@ -46,7 +46,7 @@ const DeleteTokenDialog = ({ onDelete, setToggleModal }: TDeleteTokendialog) =>
4646
<div className='modal-overlay'>
4747
<Modal.Overlay />
4848
<Modal.DialogContent
49-
title='Deleting token'
49+
title='Delete token'
5050
content='Are you sure you want to delete this token?'
5151
action_buttons={actionButtons}
5252
has_close_button

src/features/dashboard/components/ApiTokenTable/__tests__/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('DeleteTokenDialog', () => {
119119
const delete_modal = await screen.findByText(/Are you sure you want to delete this token?/i);
120120
expect(delete_modal).toBeInTheDocument();
121121

122-
const cancel_button = await screen.findByRole('button', { name: 'No, keep it' });
122+
const cancel_button = await screen.findByRole('button', { name: 'Cancel' });
123123
await userEvent.click(cancel_button);
124124

125125
expect(delete_modal).not.toBeInTheDocument();

src/features/dashboard/components/ApiTokenTable/cells.module.scss

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,35 @@
1414
background-repeat: no-repeat;
1515
background-position: center;
1616
background-image: url(/img/delete.svg);
17-
background-color: var(--colors-greyLight200);
18-
border: 1px solid var(--colors-greyLight400);
1917
border-radius: 100%;
2018
cursor: pointer;
2119
&:hover {
2220
&::after {
23-
content: 'Delete token';
24-
text-align: center;
25-
position: absolute;
26-
display: inline-block;
27-
border-radius: 4px;
28-
padding: rem(1);
29-
color: var(--ifm-color-emphasis-100);
30-
background-color: var(--ifm-color-emphasis-700);
31-
font-size: var(--fontSizes-3xs);
32-
top: calc(-50% - 20px);
33-
left: 50%;
34-
min-width: 100px;
35-
transform: translate(-50%, -50%);
21+
content: 'Delete token';
22+
text-align: center;
23+
position: absolute;
24+
display: inline-block;
25+
border-radius: 4px;
26+
padding: rem(1);
27+
color: var(--ifm-color-emphasis-100);
28+
background-color: var(--ifm-color-emphasis-700);
29+
font-size: var(--fontSizes-3xs);
30+
top: calc(-50% - 20px);
31+
left: 50%;
32+
min-width: 100px;
33+
transform: translate(-50%, -50%);
3634
}
3735
&::before {
38-
content: '';
39-
position: absolute;
40-
width: 0;
41-
height: 0;
42-
border-left: rem(0.7) solid transparent;
43-
border-right: rem(0.7) solid transparent;
44-
border-top: rem(0.7) solid var(--ifm-color-emphasis-700);
45-
top: calc(-50% + 2px);
46-
transform: translate(-50%, -50%);
47-
left: 50%;
36+
content: '';
37+
position: absolute;
38+
width: 0;
39+
height: 0;
40+
border-left: rem(0.7) solid transparent;
41+
border-right: rem(0.7) solid transparent;
42+
border-top: rem(0.7) solid var(--ifm-color-emphasis-700);
43+
top: calc(-50% + 2px);
44+
transform: translate(-50%, -50%);
45+
left: 50%;
4846
}
4947
}
5048
}

src/features/dashboard/components/AppsTable/__tests__/apps-table.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe('Apps Table', () => {
8888
const deleteDialogTitle = await screen.findByText('Are you sure you want to delete this app?');
8989
expect(deleteDialogTitle).toBeInTheDocument();
9090

91-
const closeDeleteDialog = await screen.findByText(/no, keep it/i);
91+
const closeDeleteDialog = await screen.findByText(/cancel/i);
9292
await userEvent.click(closeDeleteDialog);
9393

9494
expect(deleteDialogTitle).not.toBeInTheDocument();

src/features/dashboard/components/Dialogs/DeleteAppDialog/__tests__/delete-app-dialog.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ describe('Delete App Dialog', () => {
4646

4747
it('Should render proper buttons', () => {
4848
const okButton = screen.getByRole('button', { name: /yes, delete/i });
49-
const cancelButton = screen.getByRole('button', { name: /no, keep it/i });
49+
const cancelButton = screen.getByRole('button', { name: /Cancel/i });
5050
expect(okButton).toBeInTheDocument();
5151
expect(cancelButton).toBeInTheDocument();
5252
});
5353

5454
it('Should call onClose on cancel button click', async () => {
55-
const cancelButton = screen.getByRole('button', { name: /no, keep it/i });
55+
const cancelButton = screen.getByRole('button', { name: /cancel/i });
5656

5757
await userEvent.click(cancelButton);
5858

src/features/dashboard/components/Dialogs/DeleteAppDialog/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const DeleteAppDialog = ({ appId, onClose }: TDeleteAppDialogProps) => {
3333
},
3434
{
3535
id: 1,
36-
text: 'No, keep it',
36+
text: 'Cancel',
3737
color: 'secondary',
3838
onClick: () => {
3939
onClose();

0 commit comments

Comments
 (0)