From ef80f5366c7cd4cf8a1f929c1c8e62062290cb17 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Fri, 24 Apr 2026 20:31:34 +0300 Subject: [PATCH] move contacts to const --- src/components/Contacts/index.tsx | 7 ++--- src/const.ts | 34 +++++++++++++++++++++++ src/store/config.ts | 46 ------------------------------- 3 files changed, 36 insertions(+), 51 deletions(-) delete mode 100644 src/store/config.ts diff --git a/src/components/Contacts/index.tsx b/src/components/Contacts/index.tsx index cea804cd..4f5df828 100644 --- a/src/components/Contacts/index.tsx +++ b/src/components/Contacts/index.tsx @@ -2,12 +2,9 @@ import s from "./contacts.module.css" import Link from "next/link" import { Title } from "@/ui/Title" -import { useSnapshot } from "valtio" -import { state } from "@/store/config" - -export const Contacts: React.FC = props => { - const { contacts } = useSnapshot(state) +import { contacts } from "@/const" +export const Contacts: React.FC = () => { return ( <> Контактная информация diff --git a/src/const.ts b/src/const.ts index f88f794b..05632ffa 100644 --- a/src/const.ts +++ b/src/const.ts @@ -21,3 +21,37 @@ export const menu: MenuItem[] = [ href: "/info", }, ] + +type Contact = { + type: string + value: string + title: string +} + +export const contacts: Contact[] = [ + { + type: "link", + value: "https://yandex.ru/maps/-/CKUkAXIb", + title: "г. Шлиссельбург ул. 18 января д. 3", + }, + { + type: "tel", + value: "tel:+78136276312", + title: "+7 (81362) 76-312", + }, + { + type: "email", + value: "mailto:hudozka@gmail.com", + title: "hudozka@gmail.com", + }, + { + type: "link", + value: "https://clck.ru/H83zS", + title: "Навигатор дополнительного образования ЛО", + }, + { + type: "link", + value: "https://vk.com/shlisselburghudozka", + title: "Вконтакте", + }, +] diff --git a/src/store/config.ts b/src/store/config.ts deleted file mode 100644 index 402f024e..00000000 --- a/src/store/config.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { proxy } from "valtio" - -type Contact = { - type: string - value: string - title: string -} - -type State = { - contacts: Contact[] -} - -export const state = proxy({ - contacts: [ - { - type: "link", - value: "https://yandex.ru/maps/-/CKUkAXIb", - title: "г. Шлиссельбург ул. 18 января д. 3", - }, - { - type: "tel", - value: "tel:+78136276312", - title: "+7 (81362) 76-312", - }, - { - type: "email", - value: "mailto:hudozka@gmail.com", - title: "hudozka@gmail.com", - }, - { - type: "link", - value: "https://clck.ru/H83zS", - title: "Навигатор дополнительного образования ЛО", - }, - { - type: "link", - value: "https://vk.com/shlisselburghudozka", - title: "Вконтакте", - }, - // { - // type: "link", - // value: "https://www.instagram.com/hudozka", - // title: "Инстаграм", - // }, - ], -})