Skip to content

Commit df05d98

Browse files
committed
fix styles for encoder picker
1 parent 2824a48 commit df05d98

File tree

2 files changed

+60
-31
lines changed

2 files changed

+60
-31
lines changed

src/features/encoder/components/token-encoder-key-format-picker.component.tsx

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ export const TokenEncoderKeyFormatPickerComponent: React.FC<
1515
const dictionary = getPickersUiDictionary(languageCode);
1616

1717
const handlePrivateKeyFormatChange = useEncoderStore(
18-
(state) => state.handleAsymmetricPrivateKeyFormatChange,
18+
(state) => state.handleAsymmetricPrivateKeyFormatChange
1919
);
2020
const controlledAsymmetricPrivateKey$ = useEncoderStore(
21-
(state) => state.controlledAsymmetricPrivateKey,
21+
(state) => state.controlledAsymmetricPrivateKey
2222
);
2323

2424
const [keyFormat, setKeyFormat] = useState<AsymmetricKeyFormatValues>(
25-
AsymmetricKeyFormatValues.PEM,
25+
AsymmetricKeyFormatValues.PEM
2626
);
2727

2828
useEffect(() => {
@@ -38,28 +38,32 @@ export const TokenEncoderKeyFormatPickerComponent: React.FC<
3838
};
3939

4040
return (
41-
<div className={styles.container}>
42-
<DebuggerPickerComponent
43-
languageCode={languageCode}
44-
label={dictionary.privateKeyFormatPicker.label}
45-
handleSelection={onPrivateKeyFormatChange}
46-
selectedOptionCode={{
47-
value: keyFormat,
48-
label: keyFormat,
49-
}}
50-
options={[
51-
{
52-
value: AsymmetricKeyFormatValues.PEM,
53-
label: AsymmetricKeyFormatValues.PEM,
54-
},
55-
{
56-
value: AsymmetricKeyFormatValues.JWK,
57-
label: AsymmetricKeyFormatValues.JWK,
58-
},
59-
]}
60-
placeholder={null}
61-
minWidth="6.125rem"
62-
/>
41+
<div className={styles.encoder__switch}>
42+
<div className={styles.container}>
43+
<div className={styles.picker}>
44+
<DebuggerPickerComponent
45+
languageCode={languageCode}
46+
label={dictionary.privateKeyFormatPicker.label}
47+
handleSelection={onPrivateKeyFormatChange}
48+
selectedOptionCode={{
49+
value: keyFormat,
50+
label: keyFormat,
51+
}}
52+
options={[
53+
{
54+
value: AsymmetricKeyFormatValues.PEM,
55+
label: AsymmetricKeyFormatValues.PEM,
56+
},
57+
{
58+
value: AsymmetricKeyFormatValues.JWK,
59+
label: AsymmetricKeyFormatValues.JWK,
60+
},
61+
]}
62+
placeholder={null}
63+
minWidth="6.125rem"
64+
/>
65+
</div>
66+
</div>
6367
</div>
6468
);
6569
};

src/features/encoder/components/token-encoder-key-format-picker.module.scss

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,47 @@
11
@use "@/libs/theme/styles/variables" as *;
22

3+
4+
.encoder__switch {
5+
display: flex;
6+
width: 100%;
7+
justify-content: flex-end;
8+
}
9+
310
.container {
411
position: relative;
512
display: flex;
613
align-items: center;
7-
gap: 0.5rem;
14+
gap: .5rem;
815

916
@media #{$breakpoint-dimension-sm} {
1017
align-self: unset;
1118
}
1219
}
1320

21+
.picker {
22+
position: relative;
23+
display: flex;
24+
justify-content: space-between;
25+
align-items: center;
26+
background: transparent;
27+
border: none;
28+
color: var(--color_fg_bold);
29+
gap: .75rem;
30+
width: 100%;
31+
}
32+
1433
.label {
15-
color: var(--color_fg_default);
16-
font-size: 0.875rem;
17-
line-height: 1.375rem;
18-
font-weight: 500;
19-
letter-spacing: 0.1px;
34+
display: flex;
35+
align-items: center;
36+
justify-content: flex-start;
37+
padding: 0;
38+
list-style-type: none;
39+
margin: 0;
40+
gap: .5rem;
41+
font-size: .875rem;
42+
line-height: 1.35;
43+
width: 100%;
44+
height: 100%;
2045
}
2146

2247
.select {

0 commit comments

Comments
 (0)