mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-05-13 17:21:53 +00:00
feat(better modalInviteMatch): Better modal match
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
@@ -1,12 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
Box,
|
|
||||||
Card,
|
Card,
|
||||||
CardBody,
|
CardBody,
|
||||||
chakra,
|
chakra,
|
||||||
|
Divider,
|
||||||
Flex,
|
Flex,
|
||||||
GridItem,
|
GridItem,
|
||||||
Image,
|
Image,
|
||||||
Spacer,
|
|
||||||
Text,
|
Text,
|
||||||
useRadio,
|
useRadio,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
@@ -21,12 +20,7 @@ export default function CardMatchedUser({
|
|||||||
notif,
|
notif,
|
||||||
...radioProps
|
...radioProps
|
||||||
}: CardMatchedUserProps) {
|
}: CardMatchedUserProps) {
|
||||||
const {
|
const { isLoading, data: matchedUser } = useQuery({
|
||||||
isLoading,
|
|
||||||
isError,
|
|
||||||
data: matchedUser,
|
|
||||||
error,
|
|
||||||
} = useQuery({
|
|
||||||
refetchOnWindowFocus: false,
|
refetchOnWindowFocus: false,
|
||||||
queryKey: ["matchUser", notif.MatchedUserID],
|
queryKey: ["matchUser", notif.MatchedUserID],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
@@ -54,7 +48,7 @@ export default function CardMatchedUser({
|
|||||||
height={"100%"}
|
height={"100%"}
|
||||||
outline={state.isChecked ? "3px solid" : "none"}
|
outline={state.isChecked ? "3px solid" : "none"}
|
||||||
outlineColor={state.isChecked ? "purple.500" : "none"}
|
outlineColor={state.isChecked ? "purple.500" : "none"}
|
||||||
bg={state.isChecked ? "purple.50" : "white"}
|
bg={state.isChecked ? "purple.100" : "purple.50"}
|
||||||
>
|
>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<Flex
|
<Flex
|
||||||
@@ -64,12 +58,16 @@ export default function CardMatchedUser({
|
|||||||
justifyContent={"space-between"}
|
justifyContent={"space-between"}
|
||||||
{...getLabelProps()}
|
{...getLabelProps()}
|
||||||
>
|
>
|
||||||
<Image src={matchedUser.images[0]}></Image>
|
<Image
|
||||||
|
src={matchedUser.images[0]}
|
||||||
|
borderRadius={"0.5rem"}
|
||||||
|
></Image>
|
||||||
<Text
|
<Text
|
||||||
align={"center"}
|
align={"center"}
|
||||||
fontSize={"1.5rem"}
|
fontSize={"1.5rem"}
|
||||||
fontWeight={"bold"}
|
fontWeight={"bold"}
|
||||||
>
|
>
|
||||||
|
<Divider />
|
||||||
{matchedUser.firstName} {matchedUser.lastName}
|
{matchedUser.firstName} {matchedUser.lastName}
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export default function ModalInviteBar({
|
|||||||
<>
|
<>
|
||||||
<Modal
|
<Modal
|
||||||
blockScrollOnMount={false}
|
blockScrollOnMount={false}
|
||||||
size={"2xl"}
|
size={"3xl"}
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
scrollBehavior={"inside"}
|
scrollBehavior={"inside"}
|
||||||
@@ -119,7 +119,10 @@ export default function ModalInviteBar({
|
|||||||
<ModalBody>
|
<ModalBody>
|
||||||
<Grid
|
<Grid
|
||||||
{...getRootProps()}
|
{...getRootProps()}
|
||||||
templateColumns={`repeat(${notificationMatch?.length}, 1fr)`}
|
templateColumns={`repeat(${notificationMatch?.length}, 50%)`}
|
||||||
|
// templateColumns={`repeat(auto-fill, ${notificationMatch?.length})`}
|
||||||
|
// make all items be in the same line and make it scrollable horizontally
|
||||||
|
|
||||||
gap={6}
|
gap={6}
|
||||||
>
|
>
|
||||||
{!isError && !error
|
{!isError && !error
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ export default function ModalModifyImages(props) {
|
|||||||
height={"100%"}
|
height={"100%"}
|
||||||
accept={"image/png, image/jpeg, image/webp"}
|
accept={"image/png, image/jpeg, image/webp"}
|
||||||
onInput={({ target }) => {
|
onInput={({ target }) => {
|
||||||
|
if (target.files[0]) return;
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
const time = date.getTime();
|
const time = date.getTime();
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import { useQuery } from "@tanstack/react-query";
|
|||||||
|
|
||||||
export default function UserProfile() {
|
export default function UserProfile() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const toast = useToast({ position: "top", isClosable: true });
|
const toast = useToast({ position: "top", isClosable: true, duration: 2000 });
|
||||||
|
|
||||||
const [currentlyLoading, setCurrentlyLoading] = useState(false);
|
const [currentlyLoading, setCurrentlyLoading] = useState(false);
|
||||||
const [passions, setPassions] = useState([] as any[]);
|
const [passions, setPassions] = useState([] as any[]);
|
||||||
|
|||||||
Reference in New Issue
Block a user