Skip to content

Commit be36e34

Browse files
author
k.golikov
committed
Some changes
1 parent 1a8d118 commit be36e34

File tree

11 files changed

+82
-29
lines changed

11 files changed

+82
-29
lines changed

src/constants/router/menuItems.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,32 @@ const menuItems: MenuItem[] = [
2828
icon: ToolFilled,
2929
routes: [
3030
{
31-
route: routes.jsonStringifier
31+
route: routes.jsonToTypescript
3232
},
3333
{
34-
route: routes.qrScanner
34+
route: routes.jsEvaluator
3535
},
3636
{
37-
route: routes.qrGenerator
37+
route: routes.diffEditor
3838
},
3939
{
40-
route: routes.bgGenerator,
41-
title: 'BG Generator'
40+
route: routes.codeFormatter
4241
},
4342
{
44-
route: routes.jsEvaluator
43+
route: routes.uuidGenerator
4544
},
4645
{
47-
route: routes.uuidGenerator
46+
route: routes.jsonStringifier
4847
},
4948
{
50-
route: routes.diffEditor
49+
route: routes.qrScanner
5150
},
5251
{
53-
route: routes.codeFormatter
52+
route: routes.qrGenerator
5453
},
5554
{
56-
route: routes.jsonToTypescript
55+
route: routes.bgGenerator,
56+
title: 'BG Generator'
5757
},
5858
{
5959
route: routes.templateTextGenerator,

src/pages/aboutPage/components/AppDependency.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import { Space } from 'antd';
33
import Text from 'antd/lib/typography/Text';
44
import styles from './AppDependency.module.scss';
55
import ExternalLink from '../../../components/ExternalLink';
6+
import getNpmPackageLink from '../../../utils/getNpmPackageLink';
67

78
interface Props {
89
name: string;
910
version: string;
1011
}
1112

1213
const AppDependency: FunctionComponent<Props> = ({ name, version }) => {
13-
const link = `https://www.npmjs.com/package/${name}`;
14+
const link = getNpmPackageLink(name);
1415

1516
return (
1617
<Space direction="horizontal" className={styles.container}>

src/pages/bgGeneratorPage/BgGeneratorPage.module.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import '../../styles/main';
2+
13
.resultImage {
24
max-width: 500px;
35
max-height: 500px;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@import '../../styles/main';
2+
3+
.BgGeneratorPage_color-picker {
4+
@include themeDark {
5+
//color: black;
6+
//background: #1d1d1d !important;
7+
8+
background: rgba(150, 150, 150, 0.15) !important;
9+
//border: 1px solid rgba(100, 100, 100, 0.2) !important;
10+
11+
label {
12+
color: #dddddd !important;
13+
}
14+
15+
input {
16+
background: transparent !important;
17+
box-shadow: rgba(100, 100, 100, 0.2) 0 0 0 1px inset !important;
18+
}
19+
20+
div.flexbox-fix {
21+
border-color: rgba(100, 100, 100, 0.2) !important;
22+
}
23+
}
24+
}

src/pages/bgGeneratorPage/BgGeneratorPage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import stringifySize from '../../utils/stringifySize';
1010
import { useDebouncedMemo } from '../../hooks/debouncedMemo';
1111
import getWindowSize from '../../utils/getWindowSize';
1212
import getScreenSize from '../../utils/getScreenSize';
13+
import './BgGeneratorPage.scss';
1314

1415
const generateImage = ({ width, height }: Size, color: string, imgCanvas: HTMLCanvasElement): string | undefined => {
1516
if (width < 0 || height < 0) {
@@ -77,7 +78,11 @@ const BgGeneratorPage = () => {
7778
<Col>
7879
<Row gutter={16}>
7980
<Col className="mb-3">
80-
<SketchPicker color={color} onChange={handleColorChange} />
81+
<SketchPicker
82+
color={color}
83+
onChange={handleColorChange}
84+
className="BgGeneratorPage_color-picker"
85+
/>
8186
</Col>
8287
<Col className="mb-3">
8388
<Space direction="vertical">

src/pages/jsonToTypeScriptPage/components/JsonToTypeScriptSettings.module.scss

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
$containerWidth: 290px;
2+
$labelWidth: 130px;
3+
$inputWidth: $containerWidth - $labelWidth;
4+
15
.formContainer {
26
display: flex;
37
flex-direction: column;
48
gap: 6px;
59

6-
width: 280px;
10+
width: $containerWidth;
711
padding-bottom: 5px;
812
}
913

@@ -15,8 +19,11 @@
1519

1620
margin-bottom: 0.25rem;
1721

18-
.closeButton {
22+
.rightSide {
1923
margin-top: -6px;
24+
display: flex;
25+
flex-direction: row;
26+
gap: 10px;
2027
}
2128
}
2229

@@ -26,12 +33,12 @@
2633
align-items: center;
2734

2835
.label {
29-
width: 120px;
36+
width: $labelWidth;
3037
}
3138

3239
.input {
3340
flex: 1;
34-
width: 160px;
35-
max-width: 160px;
41+
width: $inputWidth;
42+
max-width: $inputWidth;
3643
}
3744
}

src/pages/jsonToTypeScriptPage/components/JsonToTypeScriptSettings.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ const JsonToTypeScriptSettings: FunctionComponent<Props> = ({ options, setOption
2424
<Col className={styles.formContainer}>
2525
<div className={styles.title}>
2626
<h3 className="mb-0">Settings</h3>
27-
{onClose && (
28-
<Button
29-
size="small"
30-
type="text"
31-
icon={<CloseOutlined />}
32-
className={styles.closeButton}
33-
onClick={onClose}
34-
/>
35-
)}
27+
<div className={styles.rightSide}>
28+
{/*<Button*/}
29+
{/* size="small"*/}
30+
{/* type="dashed"*/}
31+
{/*>*/}
32+
{/* Reset*/}
33+
{/*</Button>*/}
34+
{onClose && <Button size="small" type="text" icon={<CloseOutlined />} onClick={onClose} />}
35+
</div>
3636
</div>
3737
<label className={styles.formItem}>
3838
<span className={styles.label}>Root type name</span>

src/pages/qrGeneratorPage/QrGeneratorPage.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ import { QRCodeSVG } from 'qrcode.react';
77
import SvgImage from '../../components/svgImage/SvgImage';
88
import styles from './QrGeneratorPage.module.scss';
99
import classNames from 'classnames';
10+
import Text from 'antd/lib/typography/Text';
11+
import ExternalLink from '../../components/ExternalLink';
12+
import getNpmPackageLink from '../../utils/getNpmPackageLink';
13+
14+
const titleExtra = (
15+
<Text type="secondary">
16+
uses <ExternalLink href={getNpmPackageLink('qrcode.react')}>qrcode.react</ExternalLink>
17+
</Text>
18+
);
1019

1120
const QrGeneratorPage: FunctionComponent = () => {
1221
const qrCodeWrapperRef = useRef<HTMLDivElement>(null);
@@ -18,7 +27,7 @@ const QrGeneratorPage: FunctionComponent = () => {
1827
const [doIncludeMargin, setDoIncludeMargin] = useInputState<boolean>(false);
1928

2029
return (
21-
<PageContainer title="QR Generator">
30+
<PageContainer title="QR Generator" titleExtra={titleExtra}>
2231
<Col xs={24} lg={12}>
2332
<TextArea value={text} onChange={setTextByEvent} placeholder="Input text" rows={3} allowClear />
2433
<label className={classNames(styles.formItem, 'mt-2')}>

src/pages/qrScannerPage/QrScannerPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Text from 'antd/lib/typography/Text';
1515
import ImgCrop from 'antd-img-crop';
1616
import CopyButton from '../../components/copyButton/CopyButton';
1717
import ExternalLink from '../../components/ExternalLink';
18+
import getNpmPackageLink from '../../utils/getNpmPackageLink';
1819

1920
interface QrImage {
2021
blob: Blob;
@@ -32,7 +33,7 @@ const beforeUpload = (file: RcFile) => {
3233

3334
const titleExtra = (
3435
<Text type="secondary">
35-
uses <ExternalLink href="https://www.npmjs.com/package/qr-scanner">qr-scanner</ExternalLink>
36+
uses <ExternalLink href={getNpmPackageLink('qr-scanner')}>qr-scanner</ExternalLink>
3637
</Text>
3738
);
3839

src/pages/uuidGeneratorPage/UuidGeneratorPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import { v4 } from 'uuid';
55
import Text from 'antd/lib/typography/Text';
66
import ExternalLink from '../../components/ExternalLink';
77
import CopyButton from '../../components/copyButton/CopyButton';
8+
import getNpmPackageLink from '../../utils/getNpmPackageLink';
89

910
const titleExtra = (
1011
<Text type="secondary">
11-
uses <ExternalLink href="https://www.npmjs.com/package/uuid">uuid</ExternalLink>
12+
uses <ExternalLink href={getNpmPackageLink('uuid')}>uuid</ExternalLink>
1213
</Text>
1314
);
1415

0 commit comments

Comments
 (0)