This commit is contained in:
Бахирев 2024-05-24 14:11:21 +03:00
parent 721e3f2e09
commit 3c4ed305c4
32 changed files with 116 additions and 78 deletions

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128.83 128.83"><defs><style>.cls-1{fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:2.93px;}</style></defs><rect class="cls-1" x="70.58" y="78.58" width="27.71" height="11.8"/><rect class="cls-1" x="42.87" y="78.58" width="27.71" height="11.8"/><rect class="cls-1" x="84.44" y="90.38" width="13.85" height="11.8"/><rect class="cls-1" x="56.73" y="90.38" width="27.71" height="11.8"/><rect class="cls-1" x="84.44" y="66.77" width="13.85" height="11.8"/><rect class="cls-1" x="56.73" y="66.77" width="27.71" height="11.8"/><rect class="cls-1" x="29.02" y="90.38" width="27.71" height="11.8"/><path class="cls-1" d="M80.86,31.81h18.32c2.93,0,5.31,2.38,5.31,5.31h0c0,2.93-2.38,5.31-5.31,5.31h-18.32v-10.62h0Z"/><polygon class="cls-1" points="64.2 37.12 80.86 42.43 80.86 31.81 64.2 37.12"/><line class="cls-1" x1="64.2" y1="37.12" x2="56.8" y2="48.74"/><path class="cls-1" d="M56.8,48.74c0-6.59-5.34-11.94-11.94-11.94s-18.65,5.15-28.14,11.94c8.58,6,21.55,11.94,28.14,11.94s11.94-5.34,11.94-11.94Z"/><line class="cls-1" x1="56.8" y1="48.74" x2="36.76" y2="48.74"/></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128.83 128.83"><defs><style>.cls-1{fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:2.93px;}</style></defs><path class="cls-1" d="M76.94,97.96h21.46c2.15,0,3.9-1.76,3.9-3.9V40.53"/><path class="cls-1" d="M80.44,20.86H36.33c-2.15,0-3.9,1.76-3.9,3.9v47.37"/><polyline class="cls-1" points="92.74 51.45 42.96 51.45 42.96 60.27 92.74 60.27 92.74 51.45"/><line class="cls-1" x1="80.44" y1="20.86" x2="102.3" y2="40.53"/><line class="cls-1" x1="32.42" y1="72.13" x2="42.96" y2="72.13"/><line class="cls-1" x1="47.05" y1="80.74" x2="42.96" y2="72.13"/><line class="cls-1" x1="47.05" y1="80.74" x2="57.91" y2="80.74"/><line class="cls-1" x1="62" y1="89.35" x2="57.91" y2="80.74"/><line class="cls-1" x1="62" y1="89.35" x2="72.85" y2="89.35"/><line class="cls-1" x1="76.94" y1="97.96" x2="72.85" y2="89.35"/><g><path class="cls-1" d="M26.53,82.13v21.93c0,2.15,1.76,3.9,3.9,3.9h40.61"/><line class="cls-1" x1="26.53" y1="82.13" x2="37.07" y2="82.13"/><line class="cls-1" x1="41.16" y1="90.74" x2="37.07" y2="82.13"/><line class="cls-1" x1="41.16" y1="90.74" x2="52.01" y2="90.74"/><line class="cls-1" x1="56.1" y1="99.35" x2="52.01" y2="90.74"/><line class="cls-1" x1="56.1" y1="99.35" x2="66.95" y2="99.35"/><line class="cls-1" x1="71.05" y1="107.96" x2="66.95" y2="99.35"/></g><path class="cls-1" d="M102.3,40.53h-18.75c-1.72,0-3.11-1.39-3.11-3.11V20.86"/><g><polyline class="cls-1" points="70.29 34.14 42.96 34.14 42.96 42.95 70.29 42.95"/><line class="cls-1" x1="70.29" y1="34.14" x2="70.29" y2="42.95"/></g><g><polyline class="cls-1" points="92.74 68.76 65.41 68.76 65.41 77.58 92.74 77.58"/><line class="cls-1" x1="92.74" y1="68.76" x2="92.74" y2="77.58"/></g></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128.83 128.83"><defs><style>.cls-1{stroke-width:2.93px;}.cls-1,.cls-2{fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;}.cls-2{stroke-width:2.66px;}</style></defs><path class="cls-2" d="M45.79,39.71c10.72,8.04,26.54,8.04,37.26,0m0,3.75v-9.65l6.83-9.99c1.06-1.55-.05-3.64-1.92-3.64H40.88c-1.87,0-2.98,2.1-1.92,3.64l6.83,9.99v9.65m37.26,3.02c0,11.19-8.34,20.27-18.63,20.27s-18.63-9.07-18.63-20.27v-12.67h37.26v12.67Zm-26.57,18.34v11.71m15.88-11.71v11.71m-15.88,0h-18.3c-8.71,0-15.77,7.06-15.77,15.77v12.75H106.43v-12.75c0-8.71-7.06-15.77-15.77-15.77h-18.3m-15.88,0l7.94,14.26m0,0l7.94-14.26m-26.57,.55l18.63,27.97m0,0l18.63-27.97m-16.12-49.72c0-1.38-1.12-2.5-2.5-2.5s-2.5,1.12-2.5,2.5,1.12,2.5,2.5,2.5,2.5-1.12,2.5-2.5Z"/><line class="cls-1" x1="47.62" y1="70.67" x2="26.78" y2="70.67"/><line class="cls-1" x1="102.02" y1="70.67" x2="81.18" y2="70.67"/></svg>

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
build/social/vk/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
import React, { ReactNode } from 'react';
import style from '../styles/index.module.scss';
import style from '../styles/wrapper.module.scss';
export interface IUiKitColumnsProps {
columns?: number;
@ -15,7 +15,7 @@ function UiKitColumns({
}: IUiKitColumnsProps) {
return (
<div
className={`${style.wrapper} ${className || ''}`}
className={`${style.ui_kit_wrapper} ${className || ''}`}
style={{ columnCount: columns || 2 }}
>
{children}

View file

@ -17,6 +17,7 @@ function UiKitInputNumber({
error,
className,
disabled,
value,
placeholder,
onChange,
@ -31,6 +32,7 @@ function UiKitInputNumber({
className={className}
>
<input
disabled={disabled}
type="number"
value={value}
placeholder={placeholder ? t(placeholder) : ''}

View file

@ -17,6 +17,8 @@ function UiKitSwitch({
error,
className,
disabled,
multiple,
value,
options,
onChange,
@ -34,18 +36,23 @@ function UiKitSwitch({
: option;
const isSelected = hasValue && selectedIds.includes(formattedOption?.id);
const customClassName = [style.ui_kit_switch_item];
if (isSelected) customClassName.push(style.ui_kit_switch_item_selected);
if (disabled) customClassName.push(style.ui_kit_switch_item_disabled);
return (
<button
key={`${formattedOption?.id}_${index}`}
className={isSelected
? `${style.ui_kit_switch_item} ${style.ui_kit_switch_item_selected}`
: style.ui_kit_switch_item}
className={customClassName.join(' ')}
onClick={() => {
if (!onChange) return;
const newSelected = isSelected
let newSelected = [formattedOption?.id];
if (multiple) {
newSelected = isSelected
? selectedIds.filter((id: any) => id !== formattedOption?.id)
: [...selectedIds, formattedOption?.id].sort();
}
onChange(newSelected);
}}

View file

@ -103,7 +103,7 @@
}
.ui_kit_button + .ui_kit_button {
margin-right: 24px;
margin-left: 24px;
}
.ui_kit_button_full_size + .ui_kit_button_full_size {

View file

@ -44,6 +44,11 @@
background-color: var(--color-button);
}
&_disabled {
pointer-events: none;
opacity: 0.5;
}
&:first-child {
border-radius: 8px 0 0 8px;
}

View file

@ -28,6 +28,7 @@ const TIMESTAMP = [
ONE_DAY * 2,
ONE_DAY * 3,
];
export function getDayName(index:number, weekday: 'long' | 'short') {
const date = new Date(TIMESTAMP[index]);
return date.toLocaleString(getLangPrefix(), { weekday: weekday || 'long' });
@ -74,10 +75,27 @@ export function getShortTime(timestamp: string) {
return date.toLocaleString(getLangPrefix(), { hour: 'numeric', minute: 'numeric' });
}
function getCurrencyFromUSD(money: number, currency: string) {
if (currency === 'USD' || !money) return money;
const k = {
USD: 1,
EUR: 0.92,
RUB: 98,
CNY: 7.26,
JPY: 158,
KRW: 1360,
CAD: 1.4,
}[currency] || 1;
return k * money;
}
export function getMoney(value: number, options?: any) {
return (value || 0).toLocaleString(getLangPrefix(), {
const currency = userSettings?.settings?.defaultSalary?.currency || 'USD';
return getCurrencyFromUSD(value || 0, currency)
.toLocaleString(getLangPrefix(), {
style: 'currency',
currency: userSettings?.settings?.defaultSalary?.currency || 'USD',
currency,
currencyDisplay: 'symbol',
maximumFractionDigits: 0,
...(options || {}),

View file

@ -8,6 +8,7 @@ import PageBox from 'ts/components/Page/Box';
import Title from 'ts/components/Title';
import localization from 'ts/helpers/Localization';
import { getDayName } from 'ts/helpers/formatter';
import formStore from '../store/Form';
@ -20,6 +21,7 @@ const Common = observer((): React.ReactElement | null => {
<Title title="page.settings.common.title"/>
<PageBox>
<UiKitSwitch
disabled
title="page.settings.common.type.title"
value={defaultSalary.type}
options={[
@ -30,6 +32,27 @@ const Common = observer((): React.ReactElement | null => {
formStore.updateState('defaultSalary.type', type?.id);
}}
/>
<UiKitSwitch
disabled
multiple
title="page.settings.common.workDaysInWeek"
value={defaultSalary.workDaysInWeek.map((v: number, i: number) => v ? (i + 1) : null)}
options={[
{ id: 1, title: getDayName(0, 'short') },
{ id: 2, title: getDayName(1, 'short') },
{ id: 3, title: getDayName(2, 'short') },
{ id: 4, title: getDayName(3, 'short') },
{ id: 5, title: getDayName(4, 'short') },
{ id: 6, title: getDayName(5, 'short') },
{ id: 7, title: getDayName(6, 'short') },
]}
onChange={(workDaysInWeek: number[]) => {
const formattedValue = (new Array(7)).fill(0)
.map((v: number, i: number) => workDaysInWeek.includes(i + 1));
console.log(formattedValue);
formStore.updateState('defaultSalary.workDaysInWeek', formattedValue);
}}
/>
<UiKitColumns>
<UiKitInputNumber
title="page.settings.common.salary"
@ -38,12 +61,12 @@ const Common = observer((): React.ReactElement | null => {
formStore.updateState('defaultSalary.value', value);
}}
/>
<UiKitSwitch
title="page.settings.common.currency"
value={defaultSalary.currency}
options={['RUB', 'USD', 'EUR']}
onChange={(currency: string) => {
formStore.updateState('defaultSalary.currency', currency);
<UiKitInputNumber
disabled
title="page.settings.common.tax"
value={defaultSalary.tax}
onChange={(value: number) => {
formStore.updateState('defaultSalary.tax', value);
}}
/>
</UiKitColumns>
@ -64,30 +87,11 @@ const Common = observer((): React.ReactElement | null => {
/>
</UiKitColumns>
<UiKitSwitch
title="page.settings.common.workDaysInWeek"
value={defaultSalary.workDaysInWeek}
options={[1, 2, 3, 4, 5, 6, 7]}
onChange={(workDaysInWeek: number) => {
formStore.updateState('defaultSalary.workDaysInWeek', workDaysInWeek);
}}
/>
<UiKitSwitch
title="page.settings.common.workDaysInWeek"
value={defaultSalary.workDaysInWeek.map((v: number, i: number) => v ? (i + 1) : null)}
options={[
{ id: 1, title: 'Пн' },
{ id: 2, title: 'Вт' },
{ id: 3, title: 'Ср' },
{ id: 4, title: 'Чт' },
{ id: 5, title: 'Пт' },
{ id: 6, title: 'Сб' },
{ id: 7, title: 'Вс' },
]}
onChange={(workDaysInWeek: number[]) => {
const formattedValue = (new Array(7)).fill(0)
.map((v: number, i: number) => workDaysInWeek.includes(i + 1));
console.log(formattedValue);
formStore.updateState('defaultSalary.workDaysInWeek', formattedValue);
title="page.settings.common.currency"
value={defaultSalary.currency}
options={['USD', 'EUR', 'RUB', 'CNY', 'JPY', 'KRW', 'CAD']}
onChange={(currency: string) => {
formStore.updateState('defaultSalary.currency', currency);
}}
/>
</PageBox>

View file

@ -50,6 +50,7 @@ function UserSalary({
}}
/>
<UiKitSwitch
disabled
title="page.settings.common.workDaysInWeek"
value={salary.workDaysInWeek}
options={[1, 2, 3, 4, 5, 6, 7]}
@ -67,6 +68,7 @@ function UserSalary({
}}
/>
<UiKitSwitch
disabled
title="page.settings.common.currency"
value={salary?.currency}
options={['RUB', 'USD', 'EUR']}

View file

@ -45,13 +45,10 @@ export default function getEmptySettings(): IUserSetting {
en: 'USD',
}[localization.language || ''] || 'EUR';
const value = {
RUB: 200000,
USD: 3000,
}[currency] || 3000;
const value = 3000;
return {
version: 1,
version: 2,
defaultSalary: {
value,
currency,

View file

@ -30,7 +30,7 @@ function Welcome() {
const command = 'git --no-pager log --raw --numstat --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%cN>%cE>%s" > log.txt\n';
return (
<>
{process.env.REACT_APP_TYPE !== 'local' && (<WarningInfo />)}
{false && process.env.REACT_APP_TYPE !== 'local' && (<WarningInfo />)}
<section className={style.welcome}>
<div className={style.welcome_row}>
<h2 className={style.welcome_first_title}>

View file

@ -14,8 +14,8 @@ export default `
§ page.settings.common.type.title: Project work type
§ page.settings.common.type.full: Full-time employment
§ page.settings.common.type.part: Project work
§ page.settings.common.salary: Monthly salary
§ page.settings.common.currency: Currency
§ page.settings.common.salary: Monthly salary in USD (US dollar, $)
§ page.settings.common.currency: Currency for view
§ page.settings.common.workDaysInYear: Number of working days in a year
§ page.settings.common.vacationDaysInYear: Number of vacation days in a year
§ page.settings.common.workDaysInWeek: Workdays

View file

@ -14,8 +14,8 @@ export default `
§ page.settings.common.type.title: Project work type
§ page.settings.common.type.full: Full-time employment
§ page.settings.common.type.part: Project work
§ page.settings.common.salary: Monthly salary
§ page.settings.common.currency: Currency
§ page.settings.common.salary: Monthly salary in USD (US dollar, $)
§ page.settings.common.currency: Currency for view
§ page.settings.common.workDaysInYear: Number of working days in a year
§ page.settings.common.vacationDaysInYear: Number of vacation days in a year
§ page.settings.common.workDaysInWeek: Workdays

View file

@ -14,8 +14,8 @@ export default `
§ page.settings.common.type.title: Project work type
§ page.settings.common.type.full: Full-time employment
§ page.settings.common.type.part: Project work
§ page.settings.common.salary: Monthly salary
§ page.settings.common.currency: Currency
§ page.settings.common.salary: Monthly salary in USD (US dollar, $)
§ page.settings.common.currency: Currency for view
§ page.settings.common.workDaysInYear: Number of working days in a year
§ page.settings.common.vacationDaysInYear: Number of vacation days in a year
§ page.settings.common.workDaysInWeek: Workdays

View file

@ -14,8 +14,8 @@ export default `
§ page.settings.common.type.title: Project work type
§ page.settings.common.type.full: Full-time employment
§ page.settings.common.type.part: Project work
§ page.settings.common.salary: Monthly salary
§ page.settings.common.currency: Currency
§ page.settings.common.salary: Monthly salary in USD (US dollar, $)
§ page.settings.common.currency: Currency for view
§ page.settings.common.workDaysInYear: Number of working days in a year
§ page.settings.common.vacationDaysInYear: Number of vacation days in a year
§ page.settings.common.workDaysInWeek: Workdays

View file

@ -14,8 +14,8 @@ export default `
§ page.settings.common.type.title: Project work type
§ page.settings.common.type.full: Full-time employment
§ page.settings.common.type.part: Project work
§ page.settings.common.salary: Monthly salary
§ page.settings.common.currency: Currency
§ page.settings.common.salary: Monthly salary in USD (US dollar, $)
§ page.settings.common.currency: Currency for view
§ page.settings.common.workDaysInYear: Number of working days in a year
§ page.settings.common.vacationDaysInYear: Number of vacation days in a year
§ page.settings.common.workDaysInWeek: Workdays

View file

@ -14,8 +14,8 @@ export default `
§ page.settings.common.type.title: Тип работы над проектом
§ page.settings.common.type.full: Полная занятость
§ page.settings.common.type.part: Проектная работа
§ page.settings.common.salary: Зарплата в месяц
§ page.settings.common.currency: Валюта
§ page.settings.common.salary: Зарплата в месяц в долларах США (USD, $)
§ page.settings.common.currency: Валюта для отображения
§ page.settings.common.workDaysInYear: Количество рабочих дней в году
§ page.settings.common.vacationDaysInYear: Количество дней отпуска в год
§ page.settings.common.workDaysInWeek: Рабочие дни

View file

@ -14,8 +14,8 @@ export default `
§ page.settings.common.type.title: Project work type
§ page.settings.common.type.full: Full-time employment
§ page.settings.common.type.part: Project work
§ page.settings.common.salary: Monthly salary
§ page.settings.common.currency: Currency
§ page.settings.common.salary: Monthly salary in USD (US dollar, $)
§ page.settings.common.currency: Currency for view
§ page.settings.common.workDaysInYear: Number of working days in a year
§ page.settings.common.vacationDaysInYear: Number of vacation days in a year
§ page.settings.common.workDaysInWeek: Workdays