feat: update social share component, and enhance modal structure

This commit is contained in:
Ardeman 2025-02-23 19:43:45 +08:00
parent e8df14880d
commit feff32f588
10 changed files with 37 additions and 18 deletions

View File

@ -23,7 +23,6 @@ export const PopupModal = ({
children, children,
description, description,
}: ModalProperties) => { }: ModalProperties) => {
if (!isOpen) return
return ( return (
<Dialog <Dialog
open={isOpen} open={isOpen}
@ -36,7 +35,10 @@ export const PopupModal = ({
transition transition
/> />
<div className="fixed inset-0 flex w-screen justify-center overflow-y-auto p-4 max-sm:bg-white sm:items-center"> <div className="fixed inset-0 flex w-screen justify-center overflow-y-auto p-4 max-sm:bg-white sm:items-center">
<DialogPanel className="max-w-lg space-y-6 rounded-lg bg-white p-8 duration-300 ease-out data-[closed]:scale-95 data-[closed]:opacity-0 sm:shadow-lg"> <DialogPanel
transition
className="max-w-lg space-y-6 rounded-lg bg-white p-8 duration-300 ease-out data-[closed]:scale-95 data-[closed]:opacity-0 sm:shadow-lg"
>
<DialogTitle className="relative flex justify-center"> <DialogTitle className="relative flex justify-center">
<button <button
onClick={onClose} onClick={onClose}

View File

@ -3,10 +3,10 @@ import { type PropsWithChildren } from 'react'
import { PopupModal } from '~/components/popup/modal' import { PopupModal } from '~/components/popup/modal'
import { SuccessModal } from '~/components/popup/success-modal' import { SuccessModal } from '~/components/popup/success-modal'
import Banner from '~/components/ui/banner' import Banner from '~/components/ui/banner'
import FormForgotPassword from '~/components/ui/form-forgot-password'
import { FormLogin } from '~/components/ui/form-login'
import { FormRegister } from '~/components/ui/form-register'
import { useNewsContext } from '~/contexts/news' import { useNewsContext } from '~/contexts/news'
import FormForgotPassword from '~/layouts/news/form-forgot-password'
import { FormLogin } from '~/layouts/news/form-login'
import { FormRegister } from '~/layouts/news/form-register'
import { FooterLinks } from './footer-links' import { FooterLinks } from './footer-links'
import { FooterNewsletter } from './footer-newsletter' import { FooterNewsletter } from './footer-newsletter'

View File

@ -2,8 +2,7 @@
import { useState, type Dispatch, type SetStateAction } from 'react' import { useState, type Dispatch, type SetStateAction } from 'react'
import { EyeIcon } from '~/components/icons/eye' import { EyeIcon } from '~/components/icons/eye'
import { Button } from '~/components/ui/button'
import { Button } from './button'
type TProperties = { type TProperties = {
setIsRegisterOpen: Dispatch<SetStateAction<boolean>> setIsRegisterOpen: Dispatch<SetStateAction<boolean>>

View File

@ -1,9 +1,9 @@
import Breadcrumb from '~/components/ui/breadcrumb' import Breadcrumb from '~/components/ui/breadcrumb'
import { Card } from '~/components/ui/card' import { Card } from '~/components/ui/card'
import { Carousel } from '~/components/ui/carousel' import { Carousel } from '~/components/ui/carousel'
import IconsSocial from '~/components/ui/icons-social' import IconsSocial from '~/components/ui/social-share'
// eslint-disable-next-line no-restricted-imports
import { BERITA, CONTENT } from '~/pages/news-detail/data' import { BERITA, CONTENT } from './data'
export const NewsDetailPage = () => { export const NewsDetailPage = () => {
const { title, content, featured, slug, author, date, tags } = CONTENT const { title, content, featured, slug, author, date, tags } = CONTENT

View File

@ -23,8 +23,10 @@
"isbot": "^5.1.17", "isbot": "^5.1.17",
"react": "^19.0.0", "react": "^19.0.0",
"react-dom": "^19.0.0", "react-dom": "^19.0.0",
"react-hook-form": "^7.54.2",
"react-router": "^7.1.3", "react-router": "^7.1.3",
"tailwind-merge": "^3.0.1" "tailwind-merge": "^3.0.1",
"zod": "link:@hookform/resolvers/zod"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^19.6.1", "@commitlint/cli": "^19.6.1",

30
pnpm-lock.yaml generated
View File

@ -35,12 +35,18 @@ importers:
react-dom: react-dom:
specifier: ^19.0.0 specifier: ^19.0.0
version: 19.0.0(react@19.0.0) version: 19.0.0(react@19.0.0)
react-hook-form:
specifier: ^7.54.2
version: 7.54.2(react@19.0.0)
react-router: react-router:
specifier: ^7.1.3 specifier: ^7.1.3
version: 7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0) version: 7.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
tailwind-merge: tailwind-merge:
specifier: ^3.0.1 specifier: ^3.0.1
version: 3.0.1 version: 3.0.1
zod:
specifier: link:@hookform/resolvers/zod
version: link:@hookform/resolvers/zod
devDependencies: devDependencies:
'@commitlint/cli': '@commitlint/cli':
specifier: ^19.6.1 specifier: ^19.6.1
@ -3402,6 +3408,12 @@ packages:
peerDependencies: peerDependencies:
react: ^19.0.0 react: ^19.0.0
react-hook-form@7.54.2:
resolution: {integrity: sha512-eHpAUgUjWbZocoQYUHposymRb4ZP6d0uwUnooL2uOybA9/3tPUvoAKqEWK1WaSiTxxOfTpffNZP7QwlnM3/gEg==}
engines: {node: '>=18.0.0'}
peerDependencies:
react: ^16.8.0 || ^17 || ^18 || ^19
react-hotkeys-hook@4.6.1: react-hotkeys-hook@4.6.1:
resolution: {integrity: sha512-XlZpbKUj9tkfgPgT9gA+1p7Ey6vFIZHttUjPqpTdyT5nqQ8mHL7elxvSbaC+dpSiHUSmr21Ya1mDxBZG3aje4Q==} resolution: {integrity: sha512-XlZpbKUj9tkfgPgT9gA+1p7Ey6vFIZHttUjPqpTdyT5nqQ8mHL7elxvSbaC+dpSiHUSmr21Ya1mDxBZG3aje4Q==}
peerDependencies: peerDependencies:
@ -4138,8 +4150,8 @@ packages:
peerDependencies: peerDependencies:
zod: ^3.18.0 zod: ^3.18.0
zod@3.24.1: zod@3.24.2:
resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==} resolution: {integrity: sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==}
snapshots: snapshots:
@ -7053,8 +7065,8 @@ snapshots:
strip-json-comments: 5.0.1 strip-json-comments: 5.0.1
summary: 2.1.0 summary: 2.1.0
typescript: 5.7.3 typescript: 5.7.3
zod: 3.24.1 zod: 3.24.2
zod-validation-error: 3.4.0(zod@3.24.1) zod-validation-error: 3.4.0(zod@3.24.2)
language-subtag-registry@0.3.23: {} language-subtag-registry@0.3.23: {}
@ -7595,6 +7607,10 @@ snapshots:
react: 19.0.0 react: 19.0.0
scheduler: 0.25.0 scheduler: 0.25.0
react-hook-form@7.54.2(react@19.0.0):
dependencies:
react: 19.0.0
react-hotkeys-hook@4.6.1(react-dom@19.0.0(react@19.0.0))(react@19.0.0): react-hotkeys-hook@4.6.1(react-dom@19.0.0(react@19.0.0))(react@19.0.0):
dependencies: dependencies:
react: 19.0.0 react: 19.0.0
@ -8397,8 +8413,8 @@ snapshots:
yocto-queue@1.1.1: {} yocto-queue@1.1.1: {}
zod-validation-error@3.4.0(zod@3.24.1): zod-validation-error@3.4.0(zod@3.24.2):
dependencies: dependencies:
zod: 3.24.1 zod: 3.24.2
zod@3.24.1: {} zod@3.24.2: {}