From e8fbf27f660bfc5fe0b51ff0b35b775e7dc25cfa Mon Sep 17 00:00:00 2001 From: =Mtg_Dev <=mtg0987654321@gmail.com> Date: Thu, 18 Nov 2021 23:36:58 +0200 Subject: [PATCH] base voting modal --- src/Components/Vote/VoteCard.tsx | 60 +++++++++++++++++++++++++++--- src/index.css | 12 ++++++ src/redux/features/modals.slice.ts | 2 +- tailwind.config.js | 5 +++ 4 files changed, 72 insertions(+), 7 deletions(-) diff --git a/src/Components/Vote/VoteCard.tsx b/src/Components/Vote/VoteCard.tsx index 21ea49c..459ab9e 100644 --- a/src/Components/Vote/VoteCard.tsx +++ b/src/Components/Vote/VoteCard.tsx @@ -1,7 +1,30 @@ import { motion } from 'framer-motion' -import { ModalCard, modalCardVariants } from '../Shared/ModalsContainer/ModalsContainer' +import React, { useState } from 'react'; +import { AiFillThunderbolt } from 'react-icons/ai' +import { IoClose } from 'react-icons/io5' +import { ModalCard, modalCardVariants } from '../Shared/ModalsContainer/ModalsContainer'; + +const defaultOptions = [ + { text: '10 sat', value: 10 }, + { text: '100 sats', value: 100 }, + { text: '1k sats', value: 1000 }, +] export default function VoteCard({ onClose, direction, ...props }: ModalCard) { + + const [selectedOption, setSelectedOption] = useState(0); + const [input, setInput] = useState(); + + const onChangeInput = (event: React.ChangeEvent) => { + setSelectedOption(-1); + setInput(Number(event.target.value)); + }; + + const onSelectOption = (idx: number) => { + setSelectedOption(idx); + setInput(defaultOptions[idx].value); + } + return ( -
-

Vote Modal

-

WIP

+ +

Upvote Project

+
+ +
+ + {/* */} +
+
+ {defaultOptions.map((option, idx) => + + )} +
+

1 sat = 1 vote

+
) diff --git a/src/index.css b/src/index.css index 1c99e91..a1657d4 100644 --- a/src/index.css +++ b/src/index.css @@ -16,6 +16,18 @@ @apply bg-gray-200 hover:bg-gray-100 text-gray-900; } + .input-wrapper { + @apply w-full relative border rounded-lg shadow flex h-42 overflow-hidden focus-within:outline-primary; + } + + .input-field { + @apply flex-grow appearance-none w-full py-2 px-3 bg-transparent text-primary-800 leading-tight focus:outline-none; + } + + .input-icon { + @apply h-full text-primary-500 flex-shrink-0 w-42 px-12; + } + .chip { @apply bg-gray-100 text-body4 px-16 py-8 rounded-24 font-regular; } diff --git a/src/redux/features/modals.slice.ts b/src/redux/features/modals.slice.ts index bc7d925..9d9b848 100644 --- a/src/redux/features/modals.slice.ts +++ b/src/redux/features/modals.slice.ts @@ -33,7 +33,7 @@ const initialState = { isLoading: false, direction: Direction.START, openModals: [ - // { modalId: ModalId.LoginSuccess } + // { modalId: ModalId.Vote } ] as OpenModal[], } as StoreState; diff --git a/tailwind.config.js b/tailwind.config.js index 3e37ad3..aed30f7 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -59,6 +59,7 @@ module.exports = { body3: ["18px", "20px"], body4: ["16px", "20px"], body5: ["14px", "20px"], + body6: ["12px", "20px"], }, fontFamily: { sans: ["Inter", "sans-serif"], @@ -75,6 +76,7 @@ module.exports = { 8: "8px", 10: "10px", 12: "12px", + 14: "14px", 16: "16px", 20: "20px", 24: "24px", @@ -99,6 +101,9 @@ module.exports = { 24: "24px", full: "50%", }, + outline: { + primary: ["2px solid #7B61FF", "1px"], + }, }, }, variants: {