mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-06 10:06:41 +07:00
added more toasts
This commit is contained in:
parent
39e801f6f3
commit
e24ea4afeb
5 changed files with 56 additions and 21 deletions
src/constants
|
@ -1,6 +1,8 @@
|
|||
import { useMemo } from 'react';
|
||||
|
||||
export const PHRASES = {
|
||||
WELCOME: ['Ого! Кто это тут у нас?'],
|
||||
GOODBYE: ['Возвращайся, мы будем скучать'],
|
||||
SIMPLE: [
|
||||
'Ответ на твоё одиночество кроется в одиночестве. Удивительно? Нет.',
|
||||
'Ах, Боря, Боренька, неужели это всё, на что мы с тобою способны?',
|
||||
|
@ -63,5 +65,8 @@ export const PHRASES = {
|
|||
],
|
||||
};
|
||||
|
||||
export const getRandomPhrase = (key: keyof typeof PHRASES) =>
|
||||
PHRASES[key][Math.floor(Math.random() * PHRASES[key].length)];
|
||||
|
||||
export const useRandomPhrase = (key: keyof typeof PHRASES) =>
|
||||
useMemo(() => PHRASES[key][Math.floor(Math.random() * PHRASES[key].length)], [key]);
|
||||
useMemo(() => getRandomPhrase(key), [key]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue