Skip to content

Commit

Permalink
обновил переменные css
Browse files Browse the repository at this point in the history
  • Loading branch information
dan0102dan committed Mar 23, 2024
1 parent ad84278 commit 63466a7
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 38 deletions.
4 changes: 3 additions & 1 deletion server/tools/dataSync/dataSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const updateData = async () => {
}

const updater = async (period) => {
console.log('Updating the database...')
try {
await updateCurrency()

Expand All @@ -56,7 +57,8 @@ const updater = async (period) => {
console.error(e.message)
}

setTimeout(updater, period)
console.log(`Completed, sleeping ${period / 1000}s...`)
setTimeout(updater, period, period)
}

export default updater
4 changes: 2 additions & 2 deletions web/src/Components/Button/Button.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react'
import styles from './Button.module.css'

const Button = ({ children, onClick, loading, styleType }) => {
const Button = ({ children, onClick, loading, styleType, disabled }) => {
return (
<button
className={styles[styleType ? styleType : 'button']}
onClick={onClick}
disabled={loading}
disabled={loading || disabled}
>
{loading ? 'Please wait...' : children}
</button>
Expand Down
20 changes: 12 additions & 8 deletions web/src/Components/Button/Button.module.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.button, .favoriteButton {
.button, .favoriteButton, .destructiveButton {
display: inline-block;
padding: 10px 18px;
margin: 12px;
font-size: 16px;
font-weight: bold;
color: var(--tg-theme-button-text-color);
background-color: var(--tg-theme-button-color);
color: var(--app-button-text-color);
background-color: var(--app-button-color);
border: none;
border-radius: 8px;
cursor: pointer;
Expand All @@ -14,16 +14,20 @@
transition: background-color 0.3s ease, color 0.3s ease;
}

.button:disabled, .favoriteButton:disabled {
color: var(--tg-theme-hint-color);
.button:disabled, .favoriteButton:disabled, .destructiveButton:disabled {
color: var(--app-subtitle-text-color);
}

.favoriteButton {
.button:active, .favoriteButton:active, .destructiveButton:active {
background-color: rgba(169, 199, 255, 0.2);
}

.favoriteButton, .destructiveButton {
width: -webkit-fill-available;
margin: 12px;
padding: 12px;
}

.button:active, .favoriteButton:active {
background-color: rgba(169, 199, 255, 0.2);
.destructiveButton {
color: var(--app-destructive-text-color)
}
12 changes: 6 additions & 6 deletions web/src/Components/Cell/Cell.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
display: flex;
align-items: center;
padding: 12px;
border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
background-color: var(--tg-theme-bg-color);
border-bottom: 1px solid var(--app-secondary-bg-color);
background-color: var(--app-bg-color);
transition: background-color 0.2s;
}

Expand All @@ -12,7 +12,7 @@
}

.cellAble:active {
background-color: var(--tg-theme-secondary-bg-color);
background-color: var(--app-secondary-bg-color);
}

.placeholderIcon, .placeholderTitle, .placeholderSubtitle {
Expand All @@ -38,7 +38,7 @@
.title {
font-size: 16px;
font-weight: bold;
color: var(--tg-theme-text-color);
color: var(--app-text-color);
}

.placeholderTitle {
Expand All @@ -49,7 +49,7 @@

.subtitle {
font-size: 14px;
color: var(--tg-theme-hint-color);
color: var(--app-subtitle-text-color);
}

.placeholderSubtitle {
Expand All @@ -66,7 +66,7 @@

.text, .textPositive, .textNegative {
font-size: 14px;
color: var(--tg-theme-text-color);
color: var(--app-text-color);
}

.textPositive {
Expand Down
4 changes: 2 additions & 2 deletions web/src/Components/InputNumber/InputNumber.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
overflow-x: hidden;
align-items: center;
background-color: var(--tg-theme-bg-color);
background-color: var(--app-bg-color);
border-radius: 0 0 8px 8px;
max-width: 100%;
margin: 0 auto;
Expand All @@ -15,7 +15,7 @@
border: none;
padding: 0;
outline: none;
color: var(--tg-theme-text-color);
color: var(--app-text-color);
background: transparent;
}

Expand Down
6 changes: 3 additions & 3 deletions web/src/Components/MiniCell/MiniCell.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
display: flex;
align-items: center;
padding: 12px;
border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
background-color: var(--tg-theme-bg-color);
border-bottom: 1px solid var(--app-section-bg-color);
background-color: var(--app-bg-color);
transition: background-color 0.2s;
}

Expand All @@ -15,7 +15,7 @@
.title {
font-size: 24px;
font-weight: bold;
color: var(--tg-theme-text-color);
color: var(--app-text-color);
}

.icon, .placeholderIcon {
Expand Down
8 changes: 4 additions & 4 deletions web/src/Components/Placeholder/Placeholder.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
.icon {
width: 56px;
height: 56px;
color: var(--tg-theme-text-color);
color: var(--app-text-color);
font-size: 3em;
}

.title {
font-size: 20px;
font-weight: bold;
color: var(--tg-theme-text-color);
color: var(--app-text-color);
margin-top: 16px;
}

.description {
font-size: 16px;
color: var(--tg-theme-hint-color);
color: var(--app-subtitle-text-color);
margin-top: 8px;
}

.errorInfo {
font-size: 16px;
color: var(--tg-theme-hint-color);
color: var(--app-subtitle-text-color);
font-style: oblique;
margin-top: 8px;
}
6 changes: 3 additions & 3 deletions web/src/Components/ProgressBar/ProgressBar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
}

.minValue, .maxValue {
color: var(--tg-theme-text-color);
color: var(--app-text-color);
}

.title {
color: var(--tg-theme-hint-color);
color: var(--app-subtitle-text-color);
}

.progressBar {
Expand All @@ -34,7 +34,7 @@
height: 100%;
top: 0;
width: 100%;
background-color: var(--tg-theme-link-color);
background-color: var(--app-link-color);
}

.progressFillPositive {
Expand Down
6 changes: 3 additions & 3 deletions web/src/Components/Search/Search.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
overflow-x: hidden;
align-items: center;
background-color: var(--tg-theme-bg-color);
background-color: var(--app-bg-color);
border-radius: 0 0 8px 8px;
max-width: 100%;
margin: 0 auto;
Expand All @@ -15,14 +15,14 @@
margin: 12px 4px 12px 4px;
font-size: 16px;
outline: none;
color: var(--tg-theme-text-color);
color: var(--app-text-color);
background: transparent;
}

.searchIcon {
width: 20px;
height: 20px;
color: var(--tg-theme-text-color);
color: var(--app-text-color);
animation: appearance 0.3s ease;
}

Expand Down
6 changes: 3 additions & 3 deletions web/src/Components/Section/Section.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
overflow-x: hidden;
margin-top: 16px;
border-radius: 8px;
background-color: var(--tg-theme-bg-color);
background-color: var(--app-bg-color);
}

.title {
padding: 16px;
font-size: 20px;
font-weight: bold;
color: var(--tg-theme-text-color);
border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
color: var(--app-section-header-text-color);
border-bottom: 1px solid var(--app-section-bg-color);
}

.loading {
Expand Down
2 changes: 1 addition & 1 deletion web/src/Components/StrokeCell/StrokeCell.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.text {
font-size: 14px;
font-weight: bold;
color: var(--tg-theme-text-color);
color: var(--app-text-color);
}

.placeholderText {
Expand Down
23 changes: 22 additions & 1 deletion web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@
box-sizing: border-box;
}

:root {
--app-bg-color: var(--tg-theme-bg-color, #FFFFFF);
--app-secondary-bg-color: var(--tg-theme-secondary-bg-color, #F5F5F5);

--app-text-color: var(--tg-theme-text-color, #000000);
--app-hint-color: var(--tg-theme-hint-color, #8A8A8A);
--app-link-color: var(--tg-theme-link-color, #1A0DAB);
--app-subtitle-text-color: var(--tg-theme-subtitle-text-color, #9A9A9A);

--app-button-color: var(--tg-theme-button-color, #F0F0F0);
--app-button-text-color: var(--tg-theme-button-text-color, #000000);

--app-header-bg-color: var(--tg-theme-header-bg-color, #EDEDED);
--app-accent-text-color: var(--tg-theme-accent-text-color, #FF9500);

--app-section-bg-color: var(--tg-theme-section-bg-color, #EFEFEF);
--app-section-header-text-color: var(--tg-theme-section-header-text-color, #303030);

--app-destructive-text-color: var(--tg-theme-destructive-text-color, #FF3B30);
}

body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
Expand All @@ -12,7 +33,7 @@ body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

background-color: var(--tg-theme-secondary-bg-color);
background-color: var(--app-secondary-bg-color);
}

code {
Expand Down
5 changes: 4 additions & 1 deletion web/src/routes/Swap/Swap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,16 @@ const Swap = () => {
title="day's range"
/>
<Button
styleType='favoriteButton'
styleType={isFavorite ? 'destructiveButton' : 'favoriteButton'}
onClick={toggleFavorite}
loading={loading || toggling}
>
{isFavorite ? 'Remove from favorites' : 'Add to favorites'}
</Button>
</Section>
{/* <Section title='Triggers' loading={loading}>
</Section> */}
</>
)
}
Expand Down

0 comments on commit 63466a7

Please sign in to comment.