добавлено отображение выбора языка
This commit is contained in:
@@ -9,7 +9,7 @@ type TProps = {
|
||||
}
|
||||
|
||||
export const LangButton:React.FC<TProps> = React.memo((props) => {
|
||||
return <div className="lang-button-container">
|
||||
return <div className="lang-button-container" onClick={() => props.onClick()}>
|
||||
<div className="lang-button-text-part">
|
||||
<span className="lang-button-text-title">{props.title}</span>
|
||||
<span className="lang-button-text-caption">{props.caption}</span>
|
||||
|
||||
@@ -164,6 +164,7 @@
|
||||
background-color: #4F4F4F;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.lang-button-container:active {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from "react";
|
||||
import React, { useState } from "react";
|
||||
import { SettingButton } from "./settingButton";
|
||||
import langIcon from './icons/languageIcon.svg';
|
||||
import shareIcon from './icons/shareIcon.svg';
|
||||
@@ -15,6 +15,11 @@ type TProps = {
|
||||
}
|
||||
|
||||
export const SettingButtons:React.FC<TProps> = React.memo((props) => {
|
||||
const [currentLang, setCurrentLang] = useState<boolean>(true); //temp
|
||||
function changeLang() {
|
||||
setCurrentLang(!currentLang);
|
||||
}
|
||||
|
||||
return <div className="setting-buttons-container">
|
||||
<div className="setting-buttons-row">
|
||||
{
|
||||
@@ -39,14 +44,16 @@ export const SettingButtons:React.FC<TProps> = React.memo((props) => {
|
||||
<LangButton
|
||||
title="Русский"
|
||||
caption="Русский"
|
||||
isSelected={true}
|
||||
onClick={props.onClickSelectLang}
|
||||
isSelected={currentLang}
|
||||
// onClick={props.onClickSelectLang}
|
||||
onClick={changeLang}
|
||||
/>
|
||||
<LangButton
|
||||
title="English"
|
||||
caption="Английский"
|
||||
isSelected={false}
|
||||
onClick={props.onClickSelectLang}
|
||||
isSelected={!currentLang}
|
||||
// onClick={props.onClickSelectLang}
|
||||
onClick={changeLang}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user