This commit is contained in:
Zakhar 2026-09-02 16:12:11 +03:00
parent 7d0478b625
commit 83589c20ec

View File

@ -22,6 +22,7 @@ export function App() {
const [isCartComplete, setIsCartComplete] = useState(false);
const [showEmptyPopup, setShowEmptyPopup] = useState(false);
const [isCartLoading, setIsCartLoading] = useState(true);
const [percent, setPercent] = useState(90);
const [openSection, setOpenSection] = useState<string>('family');
const [needRefresh, setNeedRefresh] = useState<boolean>(true);
const [isFullnessHighlighted, setIsFullnessHighlighted] = useState<boolean>(false);
@ -35,6 +36,7 @@ export function App() {
const loadInitialState = async () => {
loadInitialData().then(data => {
setInitialData(data);
// setPercent(data.percent);
dispatch(setUsers(data.users));
setProducts(data.cart.flat().map(product => normalizeProductImage(product)));
setInitial(false, data.excess || 0, data.precision || 0);
@ -199,7 +201,7 @@ export function App() {
icon={<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17 13.23C17 13.23 16.09 12.77 15.182 12.77C13.818 12.77 12 14.615 12 17.385C12 20.154 14.49 22 17 22C19.51 22 22 20.154 22 17.385C22 14.616 20.182 12.769 18.818 12.769C17.909 12.769 17 13.231 17 13.231C17 11.847 17.91 10.001 19.727 10.001M10.655 5C11.551 5 12.278 4.328 12.278 3.5C12.278 2.672 11.55 2 10.655 2H5.245C4.349 2 3.623 2.672 3.623 3.5C3.623 4.328 4.349 5 5.246 5M11.169 4.923C12.125 6.689 12.909 8.283 13.389 10C13.4283 10.14 13.4653 10.281 13.5 10.423M10.428 22H6.328C2.747 22 2 21.31 2 18V13.777C2 10.377 3.098 7.886 4.705 4.915" stroke="#859D96" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>}
description={openSection === 'fullness' ? 'Чем меньше значение, тем меньше продуктов и калорий в корзине' : ''}
description={openSection === 'fullness' ? 'Чем меньше значение, тем меньше продуктов и калорий в корзине' : percent + '% — ваша цель. Результат может варьироваться'}
isHighlighted={isFullnessHighlighted}
isOpen={openSection === 'fullness'}
onToggle={() => {
@ -209,7 +211,7 @@ export function App() {
setOpenSection(openSection === 'fullness' ? '' : 'fullness')
}}
>
<CustomSlider onChange={(percent) => {console.log(percent)}} />
<CustomSlider defaultValue={percent} onChange={setPercent} />
<Alert>
<div>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">