frontend: create ayedance in greeting
This commit is contained in:
parent
0edcae1a24
commit
98e5ef06c0
@ -1,9 +1,16 @@
|
||||
import { useCookies } from "react-cookie";
|
||||
import CenteredContainer from "./ChildrenContainer";
|
||||
import useFetchUser from "../utils/fetchUser";
|
||||
|
||||
function Greeting() {
|
||||
const [cookie] = useCookies<string>(['userName'])
|
||||
const userName = cookie.userName;
|
||||
const { updateAttendance } = useFetchUser()
|
||||
|
||||
const handleUpdate = async (status: boolean) => {
|
||||
await updateAttendance(status)
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -17,10 +24,27 @@ function Greeting() {
|
||||
Приглашаем тебя отпраздновать предстоящий Новый Год <b>2025-2026</b> с нами в сосновой избе, в которой, ко всему прочему, будет праздноваться годовщина нашей жизни в ней!
|
||||
|
||||
Наши двери открыты с <b>30.12.2025</b>. Праздник обычно длится до <b>01.01.2025</b>, но если тебе или твоим спутникам будет безумно плохо, то можно остаться и до второго числа.
|
||||
<h3>Присоеденишься?</h3>
|
||||
<p>(Можно и потом ответить)</p>
|
||||
<button style={localStyles.buttonOk} onClick={() => handleUpdate(true)}>Да!</button>
|
||||
<button style={localStyles.buttonNok}onClick={() => handleUpdate(false)}>Не смогу в этот раз</button>
|
||||
</p>
|
||||
</CenteredContainer>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
const localStyles = {
|
||||
buttonOk: {
|
||||
margin: '0.5em',
|
||||
padding: '0.3em',
|
||||
backgroundColor: 'green'
|
||||
},
|
||||
buttonNok: {
|
||||
margin: '0.5em',
|
||||
padding: '0.3em',
|
||||
backgroundColor: 'red'
|
||||
}
|
||||
}
|
||||
|
||||
export default Greeting;
|
||||
Loading…
x
Reference in New Issue
Block a user