diff --git a/app/[lang]/(web)/(base page)/(learn)/web3mooc./components/Content/Overview.tsx b/app/[lang]/(web)/(base page)/(learn)/web3mooc./components/Content/Overview.tsx index 8aab8b5e2..ad6b6179f 100644 --- a/app/[lang]/(web)/(base page)/(learn)/web3mooc./components/Content/Overview.tsx +++ b/app/[lang]/(web)/(base page)/(learn)/web3mooc./components/Content/Overview.tsx @@ -60,19 +60,22 @@ const Overview: React.FC = () => {

{t(overviewData.name)}

-
+

{t('ntuCourse.date')}

{overviewData.date}

-
+

{t('ntuCourse.time')}

{overviewData.time}

+

+ {`Please review individual lecture schedule under Syllabus as speakers are from different time zones.`} +

-
+

{t('ntuCourse.overview.format')}

{overviewData.format}

-
+

{t('ntuCourse.overview.hosts')}

hack_logo @@ -81,7 +84,7 @@ const Overview: React.FC = () => {
-
+

{t('ntuCourse.overview.discussionGroups')}

{overviewData.discussionGroups.map((v) => ( diff --git a/app/[lang]/(web)/(base page)/(learn)/web3mooc./constants/data.tsx b/app/[lang]/(web)/(base page)/(learn)/web3mooc./constants/data.tsx index 2b0e80c6b..ad6a2e834 100644 --- a/app/[lang]/(web)/(base page)/(learn)/web3mooc./constants/data.tsx +++ b/app/[lang]/(web)/(base page)/(learn)/web3mooc./constants/data.tsx @@ -41,7 +41,7 @@ export const titleTxtData = [ export const overviewData = { name: 'ntuCourse.overview.title', date: 'Weekly sessions from 5/28-9/24/2024', - time: '9-10 am SGT, Tuesday / 9-10 pm EST, Monday (*Please review individual lecture schedule under Syllabus as speakers are from different time zones).', + time: '9-10 am SGT, Tuesday / 9-10 pm EST, Monday', format: 'Hybrid (In-person at NTU and Online over ZOOM)', discussionGroups: [ { @@ -85,7 +85,7 @@ export const syllabusData = [ description: 'This introductory session is dedicated to bridging the gap between Web2 and Web3. In this session, students will review key Web3 concepts, learn key differences between Web2 and Web3, explore the Ethereum ecosystem, and discover how to begin building in this transformative new space as a Web3 developer.', speaker: 'Austin Griffith, Ethereum Foundation', - video: '', + video: 'https://drive.google.com/file/d/1efRXsQZL_nkLS1ZXMLEYswNsuUYKXp1c/view', slide: '', expand: false }, @@ -95,8 +95,9 @@ export const syllabusData = [ description: 'Gain a comprehensive understanding of the current Web3 ecosystem. Explore different blockchain ecosystems and key protocols and standards, with an emphasis on infrastructure.', speaker: 'Dr. Michael Yuan, Gaianet', - video: '', - slide: '', + video: 'https://drive.google.com/file/d/1VK6U3CGXRavinw5BWSb0BTaYyYHrB0h_/view?usp=drive_link', + slide: + 'https://docs.google.com/presentation/d/1EUlPND_1HO0HyiEhfcWM2pF-LlcaPyxRfMMG3-UH15c/edit#slide=id.g2dc6d916b77_1_2', expand: false }, { diff --git a/app/[lang]/(web)/(base page)/(learn)/web3mooc/components/Content/Overview.tsx b/app/[lang]/(web)/(base page)/(learn)/web3mooc/components/Content/Overview.tsx index 8aab8b5e2..ad6b6179f 100644 --- a/app/[lang]/(web)/(base page)/(learn)/web3mooc/components/Content/Overview.tsx +++ b/app/[lang]/(web)/(base page)/(learn)/web3mooc/components/Content/Overview.tsx @@ -60,19 +60,22 @@ const Overview: React.FC = () => {

{t(overviewData.name)}

-
+

{t('ntuCourse.date')}

{overviewData.date}

-
+

{t('ntuCourse.time')}

{overviewData.time}

+

+ {`Please review individual lecture schedule under Syllabus as speakers are from different time zones.`} +

-
+

{t('ntuCourse.overview.format')}

{overviewData.format}

-
+

{t('ntuCourse.overview.hosts')}

hack_logo @@ -81,7 +84,7 @@ const Overview: React.FC = () => {
-
+

{t('ntuCourse.overview.discussionGroups')}

{overviewData.discussionGroups.map((v) => ( diff --git a/app/[lang]/(web)/(base page)/(learn)/web3mooc/constants/data.tsx b/app/[lang]/(web)/(base page)/(learn)/web3mooc/constants/data.tsx index 2b0e80c6b..ad6a2e834 100644 --- a/app/[lang]/(web)/(base page)/(learn)/web3mooc/constants/data.tsx +++ b/app/[lang]/(web)/(base page)/(learn)/web3mooc/constants/data.tsx @@ -41,7 +41,7 @@ export const titleTxtData = [ export const overviewData = { name: 'ntuCourse.overview.title', date: 'Weekly sessions from 5/28-9/24/2024', - time: '9-10 am SGT, Tuesday / 9-10 pm EST, Monday (*Please review individual lecture schedule under Syllabus as speakers are from different time zones).', + time: '9-10 am SGT, Tuesday / 9-10 pm EST, Monday', format: 'Hybrid (In-person at NTU and Online over ZOOM)', discussionGroups: [ { @@ -85,7 +85,7 @@ export const syllabusData = [ description: 'This introductory session is dedicated to bridging the gap between Web2 and Web3. In this session, students will review key Web3 concepts, learn key differences between Web2 and Web3, explore the Ethereum ecosystem, and discover how to begin building in this transformative new space as a Web3 developer.', speaker: 'Austin Griffith, Ethereum Foundation', - video: '', + video: 'https://drive.google.com/file/d/1efRXsQZL_nkLS1ZXMLEYswNsuUYKXp1c/view', slide: '', expand: false }, @@ -95,8 +95,9 @@ export const syllabusData = [ description: 'Gain a comprehensive understanding of the current Web3 ecosystem. Explore different blockchain ecosystems and key protocols and standards, with an emphasis on infrastructure.', speaker: 'Dr. Michael Yuan, Gaianet', - video: '', - slide: '', + video: 'https://drive.google.com/file/d/1VK6U3CGXRavinw5BWSb0BTaYyYHrB0h_/view?usp=drive_link', + slide: + 'https://docs.google.com/presentation/d/1EUlPND_1HO0HyiEhfcWM2pF-LlcaPyxRfMMG3-UH15c/edit#slide=id.g2dc6d916b77_1_2', expand: false }, { diff --git a/app/[lang]/(web)/(base page)/(resource)/hackathon/components/HackathonBox/OnGoing/OnGoingHackathonCard/index.tsx b/app/[lang]/(web)/(base page)/(resource)/hackathon/components/HackathonBox/OnGoing/OnGoingHackathonCard/index.tsx index 97685dd19..29184f09d 100644 --- a/app/[lang]/(web)/(base page)/(resource)/hackathon/components/HackathonBox/OnGoing/OnGoingHackathonCard/index.tsx +++ b/app/[lang]/(web)/(base page)/(resource)/hackathon/components/HackathonBox/OnGoing/OnGoingHackathonCard/index.tsx @@ -143,7 +143,7 @@ const OnGoingHackathonCard: React.FC = ({ hackathon })

{t('participants')}

-

{separationNumber(hackathon.members?.length || 0)}

+

{separationNumber(hackathon.memberCount || 0)}

{t('totalPrize')}

diff --git a/app/[lang]/(web)/(base page)/(resource)/hackathon/components/HackathonBox/Past/PastHackathonCard/index.tsx b/app/[lang]/(web)/(base page)/(resource)/hackathon/components/HackathonBox/Past/PastHackathonCard/index.tsx index 5ca2bc982..882df191b 100644 --- a/app/[lang]/(web)/(base page)/(resource)/hackathon/components/HackathonBox/Past/PastHackathonCard/index.tsx +++ b/app/[lang]/(web)/(base page)/(resource)/hackathon/components/HackathonBox/Past/PastHackathonCard/index.tsx @@ -61,7 +61,7 @@ const PastHackathonCard: FC = ({ hackathon, isVoting }) {hackathon.version === 'old' ? hackathon.participants - : separationNumber(hackathon.members?.length || 0)} + : separationNumber(hackathon.memberCount || 0)}
diff --git a/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/components/Content/Overview.tsx b/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/components/Content/Overview.tsx index 210c66481..5bed8fc7f 100644 --- a/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/components/Content/Overview.tsx +++ b/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/components/Content/Overview.tsx @@ -11,6 +11,7 @@ import Link from 'next/link'; import MenuLink from '@/constants/MenuLink'; import { DiGithubBadge } from 'react-icons/di'; import { IoIosArrowForward } from 'react-icons/io'; +import { cn } from '@/helper/utils'; interface OverviewProp { project: ProjectType; @@ -23,6 +24,9 @@ const Overview: React.FC = ({ project, hackathon }) => { const newGithubLink = useMemo(() => { return /^[http]/.test(project.githubLink) ? project.githubLink : `https://${project.githubLink}`; }, [project]); + + const showGithubModule = project.isOpenSource && project.githubLink; + return (
@@ -37,35 +41,51 @@ const Overview: React.FC = ({ project, hackathon }) => {
-
+
hackathon-icon -
+

{t('navbar.resources.hackathon')}

{project.hackathonName}
-
+ +
prize-icon -
+

{t('projectsDetail.prizeTrack')}

-

{project.prizeTrack || '-'}

+

+ {project.prizeTrack?.split(',').join(', ') || '-'} +

-
+ +
hackathon-track-icon -
+

{t('projectsDetail.hackathonTrack')}

-
{project.tracks?.map((v) => {v})}
+

+ {project.tracks?.join(', ')} +

- {project.githubLink && ( -
+ {showGithubModule && ( +

{t('projectsDetail.openSource')}

diff --git a/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/edit/components/Content/Info/ProjectPrizeTrackRadio/index.tsx b/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/edit/components/Content/Info/ProjectPrizeTrackRadio/index.tsx index daee0252f..9dd22515f 100644 --- a/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/edit/components/Content/Info/ProjectPrizeTrackRadio/index.tsx +++ b/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/edit/components/Content/Info/ProjectPrizeTrackRadio/index.tsx @@ -1,6 +1,7 @@ import { cn } from '@/helper/utils'; import { UseFormReturn } from 'react-hook-form'; import { FormSchema } from '../../constants'; +import { useState } from 'react'; interface ProjectTypeRadioProps { form: UseFormReturn; @@ -9,6 +10,8 @@ interface ProjectTypeRadioProps { } const ProjectPrizeTrackRadio = ({ form, tracks, isClose }: ProjectTypeRadioProps) => { + const [selectTracks, setSelectTracks] = useState(form.watch('prizeTrack').split(',')); + console.log(selectTracks); return (

Which Hackathon Track Do You Belong To

@@ -19,12 +22,20 @@ const ProjectPrizeTrackRadio = ({ form, tracks, isClose }: ProjectTypeRadioProps key={track} onClick={() => { if (isClose) return; - form.setValue('prizeTrack', track); + let newTracks = [...selectTracks]; + if (selectTracks.includes(track)) { + newTracks = selectTracks.filter((t) => t !== track); + form.setValue('prizeTrack', newTracks.join(',')); + } else { + newTracks = selectTracks.concat(track); + form.setValue('prizeTrack', newTracks.join(',')); + } + setSelectTracks(newTracks); form.trigger('prizeTrack'); }} className={cn( `body-m flex h-[50px] w-full items-center justify-center gap-3 rounded-[8px] border-[3px] border-neutral-off-white px-5 py-3`, - form.watch('prizeTrack') === track + selectTracks.includes(track) ? 'border-yellow-dark bg-yellow-extra-light shadow-[0px_0px_8px_0px_rgba(249,216,28,0.30)]' : 'bg-neutral-white', isClose ? 'cursor-not-allowed' : 'cursor-pointer' diff --git a/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/edit/components/Content/Info/ProjectTrackRadio/index.tsx b/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/edit/components/Content/Info/ProjectTrackRadio/index.tsx index 1e4219a84..32af6a01f 100644 --- a/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/edit/components/Content/Info/ProjectTrackRadio/index.tsx +++ b/app/[lang]/(web)/(base page)/(resource)/hackathon/projects/[projectId]/edit/components/Content/Info/ProjectTrackRadio/index.tsx @@ -16,7 +16,7 @@ const ProjectTrackRadio = ({ form, tracks, isClose }: ProjectTypeRadioProps) => return (

{`Which Hackathon Track Do You Belong To (Please elect all that apply)`}

-
+
{tracks.map((track) => { return (
> = ({ const { redirectToUrl } = useRedirect(); const { name, contractInfo, bio, submissionType, isRegister } = formState; const confirmModalRef = useRef(null); + const [allowContract, setAllowContract] = useState(true); const { runAsync, loading } = useRequest( () => { - return webApi.resourceStationApi.registerHackathon(simpleHackathonInfo.id); + return webApi.resourceStationApi.registerHackathon(simpleHackathonInfo.id, { + allowContract: allowContract + }); }, { manual: true, @@ -230,6 +233,60 @@ const SubmitReview: FC> = ({

Do you want to {isRegister ? 'update' : 'register'} this hackathon?

+ {!isRegister && ( + <> +

+ Consensys is committed to protecting and respecting your privacy, and we’ll only use your personal + information to provide the products, services, and information you requested from us. From time to time, + we would like to contact you about our products and services, as well as other content that may be of + interest to you. If you consent to us contacting you for this purpose: +

+ {/*
+ { + setConsent(!consent); + }} + > + + + Yes, I consent. +
*/} +
+
{ + setAllowContract(true); + }} + className={cn( + `body-m flex h-[50px] w-full cursor-pointer items-center justify-center gap-3 rounded-[8px] border-[3px] border-neutral-off-white px-5 py-3`, + allowContract === true + ? 'border-yellow-dark bg-yellow-extra-light shadow-[0px_0px_8px_0px_rgba(249,216,28,0.30)]' + : '' + )} + > + Yes +
+
{ + setAllowContract(false); + }} + className={cn( + `body-m flex h-[50px] w-full cursor-pointer items-center justify-center gap-3 rounded-[8px] border-[3px] border-neutral-off-white px-5 py-3`, + allowContract === false + ? 'border-yellow-dark bg-yellow-extra-light shadow-[0px_0px_8px_0px_rgba(249,216,28,0.30)]' + : '' + )} + > + No +
+
+ + )}
); diff --git a/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/DetailIntroName/index.tsx b/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/DetailIntroName/index.tsx index e16c21aa2..14530a940 100644 --- a/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/DetailIntroName/index.tsx +++ b/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/DetailIntroName/index.tsx @@ -20,7 +20,7 @@ const DetailIntroName: FC = ({ form }) => { {'Detailed Intro of Your Project'} - 120 ? 'text-status-error' : ''}> + 600 ? 'text-status-error' : ''}> {form.watch('detailedIntro').length} /600 diff --git a/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/ProjectTrackRadio/index.tsx b/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/ProjectTrackRadio/index.tsx index 48c01393f..4de1207af 100644 --- a/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/ProjectTrackRadio/index.tsx +++ b/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/ProjectTrackRadio/index.tsx @@ -17,7 +17,7 @@ const ProjectTrackRadio = ({ form, tracks }: ProjectTypeRadioProps) => {

{`Which Hackathon Track Do You Belong To (Please select all that apply)`}

-
+
{tracks.map((track) => { return (
{ form.trigger('track'); }} className={cn( - `body-m flex h-[50px] w-full cursor-pointer items-center justify-center gap-3 rounded-[8px] border-[3px] border-neutral-off-white px-5 py-3`, + `body-m flex w-full max-w-[8.0625rem] cursor-pointer items-center justify-center gap-3 rounded-[8px] border-[3px] border-neutral-off-white px-5 py-3`, selectTracks.includes(track.value) ? 'border-yellow-dark bg-yellow-extra-light shadow-[0px_0px_8px_0px_rgba(249,216,28,0.30)]' : '' diff --git a/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/index.tsx b/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/index.tsx index ed5981679..83e6200f5 100644 --- a/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/index.tsx +++ b/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/FormComponent/InfoForm/index.tsx @@ -26,10 +26,11 @@ import { LangContext } from '@/components/Provider/Lang'; import { isEqual } from 'lodash-es'; import CustomSelectField from '@/components/Web/Business/CustomSelectField'; import ProjectTrackRadio from './ProjectTrackRadio'; -import ProjectPrizeTrackRadio from './ProjectPrizeTrackRadio'; import emitter from '@/store/emitter'; import ConfirmModal, { ConfirmModalRef } from '@/components/Web/Business/ConfirmModal'; import MenuLink from '@/constants/MenuLink'; +import FormRadio from '@/components/Common/FormRadio'; +import FormRadioItem from '@/components/Common/FormRadio/FormRadioItem'; const formSchema = z.object({ projectLogo: z.string().url(), @@ -64,7 +65,7 @@ export type InfoFormSchema = z.infer; const InfoForm: FC< Omit & Pick -> = ({ onNext, onBack, info, tracks, simpleHackathonInfo, projectId, status, isSubmit }) => { +> = ({ onNext, onBack, info, tracks: prizeTrack, simpleHackathonInfo, projectId, status, isSubmit }) => { // 1. Define your form. const form = useForm>({ resolver: zodResolver(formSchema), @@ -204,7 +205,12 @@ const InfoForm: FC< placeholder="Please select" items={LOCATIONS} > - + {/* */} + + {prizeTrack.map((t) => ( + + ))} + {/*
diff --git a/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/constants/index.tsx b/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/constants/index.tsx index cc151b00c..8952e4d53 100644 --- a/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/constants/index.tsx +++ b/app/[lang]/(web)/(other)/form/hackathon/[hackathonId]/submission/[projectId]/components/constants/index.tsx @@ -71,11 +71,15 @@ export const LOCATIONS = [ }, { label: 'Other', - value: 'Other' + value: ProjectLocation.OTHER } ]; export const TRACKS = [ + { + label: 'SocialFi', + value: 'SocialFi' + }, { label: 'DeFi', value: 'DeFi' @@ -88,13 +92,25 @@ export const TRACKS = [ label: 'GameFi', value: 'GameFi' }, - { - label: 'SociFi', - value: 'SociFi' - }, { label: 'Infra', value: 'Infra' + }, + { + label: 'DAO', + value: 'DAO' + }, + { + label: 'RWA', + value: 'RWA' + }, + { + label: 'AI', + value: 'AI' + }, + { + label: 'Other', + value: 'Other' } ]; diff --git a/app/[lang]/mobile/(base page)/(learn)/web3mooc./components/Content/Overview.tsx b/app/[lang]/mobile/(base page)/(learn)/web3mooc./components/Content/Overview.tsx index f1ccdfa86..364d7fbf3 100644 --- a/app/[lang]/mobile/(base page)/(learn)/web3mooc./components/Content/Overview.tsx +++ b/app/[lang]/mobile/(base page)/(learn)/web3mooc./components/Content/Overview.tsx @@ -69,6 +69,9 @@ const Overview: React.FC = ({ lang }) => {

{t('ntuCourse.time')}

{overviewData.time}

+

+ {`Please review individual lecture schedule under Syllabus as speakers are from different time zones.`} +

{t('ntuCourse.overview.format')}

diff --git a/app/[lang]/mobile/(base page)/(learn)/web3mooc/components/Content/Overview.tsx b/app/[lang]/mobile/(base page)/(learn)/web3mooc/components/Content/Overview.tsx index f1ccdfa86..38b74d25b 100644 --- a/app/[lang]/mobile/(base page)/(learn)/web3mooc/components/Content/Overview.tsx +++ b/app/[lang]/mobile/(base page)/(learn)/web3mooc/components/Content/Overview.tsx @@ -65,6 +65,9 @@ const Overview: React.FC = ({ lang }) => {

{t('ntuCourse.date')}

{overviewData.date}

+

+ {`Please review individual lecture schedule under Syllabus as speakers are from different time zones.`} +

{t('ntuCourse.time')}

diff --git a/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/OnGoing/OnGoingHackathonCard/index.tsx b/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/OnGoing/OnGoingHackathonCard/index.tsx index 0f245b779..125c39fbd 100644 --- a/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/OnGoing/OnGoingHackathonCard/index.tsx +++ b/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/OnGoing/OnGoingHackathonCard/index.tsx @@ -131,9 +131,7 @@ const OnGoingHackathonCard: React.FC = ({ hackathon })
{t('participants')} - - {separationNumber(hackathon.members?.length || 0)} - + {separationNumber(hackathon.memberCount || 0)}
{t('totalPrize')} diff --git a/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/Past/PastHackathonCard/index.tsx b/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/Past/PastHackathonCard/index.tsx index 130fea15d..3373456d9 100644 --- a/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/Past/PastHackathonCard/index.tsx +++ b/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/Past/PastHackathonCard/index.tsx @@ -69,7 +69,7 @@ const PastHackathonCard: FC = ({ hackathon, isVoting })

{hackathon.version === 'old' ? hackathon.participants - : separationNumber(hackathon.members?.length || 0)} + : separationNumber(hackathon.memberCount || 0)}

diff --git a/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/index.tsx b/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/index.tsx index 319f447f2..d7a602f7e 100644 --- a/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/index.tsx +++ b/app/[lang]/mobile/(base page)/(resource)/hackathon/components/HackathonBox/index.tsx @@ -64,7 +64,7 @@ const HackathonBox: React.FC = ({ page, curTab, hackathonList, />
-
{t('allHackathons')}
+
{t('allHackathons')}
{renderHackathon()}
diff --git a/app/[lang]/mobile/(base page)/(resource)/hackathon/explore/components/explore-content.tsx b/app/[lang]/mobile/(base page)/(resource)/hackathon/explore/components/explore-content.tsx index 64f7a47df..df0bc5582 100644 --- a/app/[lang]/mobile/(base page)/(resource)/hackathon/explore/components/explore-content.tsx +++ b/app/[lang]/mobile/(base page)/(resource)/hackathon/explore/components/explore-content.tsx @@ -38,9 +38,9 @@ export function ExploreContent({ }; return ( <> -
+
-
{t('allHackathons')}
+
{t('allHackathons')}
{renderHackathon()}
diff --git a/app/[lang]/mobile/(base page)/(resource)/hackathon/projects/[projectId]/components/Content/Overview.tsx b/app/[lang]/mobile/(base page)/(resource)/hackathon/projects/[projectId]/components/Content/Overview.tsx index b7c3b6201..eb2c326a6 100644 --- a/app/[lang]/mobile/(base page)/(resource)/hackathon/projects/[projectId]/components/Content/Overview.tsx +++ b/app/[lang]/mobile/(base page)/(resource)/hackathon/projects/[projectId]/components/Content/Overview.tsx @@ -58,7 +58,9 @@ const Overview: React.FC = ({ project, hackathon }) => {

{t('projectsDetail.prizeTrack')}

-

{project.prizeTrack || '-'}

+

+ {project.prizeTrack?.split(',').join(', ') || '-'} +

@@ -68,7 +70,9 @@ const Overview: React.FC = ({ project, hackathon }) => {

{t('projectsDetail.hackathonTrack')}

-
{project.tracks?.map((v) => {v})}
+

+ {project.tracks?.join(', ')} +

{project.githubLink && ( diff --git a/components/Common/FormRadio/index.tsx b/components/Common/FormRadio/index.tsx index 48cbca8c9..2e193d021 100644 --- a/components/Common/FormRadio/index.tsx +++ b/components/Common/FormRadio/index.tsx @@ -1,10 +1,10 @@ -import React, { FC, ReactElement, createContext, useState } from 'react'; -import { UseFormReturn } from 'react-hook-form'; +import React, { ReactElement, createContext, useState } from 'react'; +import { FieldValues, Path, UseFormReturn } from 'react-hook-form'; -interface FormRadioProps { +interface FormRadioProps { children: ReactElement | ReactElement[]; - name: string; - form: UseFormReturn; + form: UseFormReturn; + name: Path; label: string; multiple?: boolean; disable?: boolean; @@ -17,7 +17,14 @@ const FormRadioContext = createContext<{ select: SelectType; setSelect: (s: Sele setSelect() {} }); -const FormRadio: FC = ({ form, label, name, children, multiple, disable }) => { +const FormRadio = ({ + form, + label, + name, + children, + multiple, + disable +}: FormRadioProps) => { const defaultSelect: string[] = multiple && form.getValues(name)?.split ? (form.getValues(name) || '').split(',') : []; const [select, setSelect] = useState(defaultSelect); diff --git a/components/Web/AI/AIChatbotModal/ChatFooter/index.tsx b/components/Web/AI/AIChatbotModal/ChatFooter/index.tsx index c548a2cec..d6e5d174c 100644 --- a/components/Web/AI/AIChatbotModal/ChatFooter/index.tsx +++ b/components/Web/AI/AIChatbotModal/ChatFooter/index.tsx @@ -44,7 +44,9 @@ const ChatFooter: ForwardRefRenderFunction } }) ); + setPendingMessage(''); + getChatbotMessage({ type: HelperType.Chat, content: pendingMessage, diff --git a/components/Web/Business/AuthModal/VerifyConfirmed/index.tsx b/components/Web/Business/AuthModal/VerifyConfirmed/index.tsx index ebfbd449d..45022cda1 100644 --- a/components/Web/Business/AuthModal/VerifyConfirmed/index.tsx +++ b/components/Web/Business/AuthModal/VerifyConfirmed/index.tsx @@ -280,6 +280,7 @@ const VerifyConfirmed: FC = (props) => { setToken(res.token || token); setAuthModalOpen(false); setVerifyState(VerifyStateType.SUCCESS); + redirectToUrl('/dashboard'); }) .catch((err) => { BurialPoint.track('signup-注册邮箱token验证失败', { diff --git a/components/Web/Business/ConfirmModal/index.tsx b/components/Web/Business/ConfirmModal/index.tsx index e156aea5a..0c448b5c4 100644 --- a/components/Web/Business/ConfirmModal/index.tsx +++ b/components/Web/Business/ConfirmModal/index.tsx @@ -10,6 +10,7 @@ interface ConfirmModalProps { confirmText?: string; cancelText?: string; className?: string; + disabled?: boolean; } interface Params { @@ -23,7 +24,7 @@ export interface ConfirmModalRef { } const ConfirmModal: ForwardRefRenderFunction = (props, ref) => { - const { children, confirmText, cancelText, className } = props; + const { children, confirmText, cancelText, className, disabled = false } = props; const [option, setOption] = useState(null); const [open, setOpen] = useState(false); @@ -89,7 +90,7 @@ const ConfirmModal: ForwardRefRenderFunction className="button-text-m w-[165px] px-0 py-4 uppercase text-neutral-black" type="primary" loading={loading} - disabled={loading} + disabled={disabled || loading} onClick={() => { option?.onConfirm && confirm(); }} diff --git a/components/Web/LessonPage/PgcCustomRenderer/QuizRenderer/QuizARenderer/CodeRender/index.tsx b/components/Web/LessonPage/PgcCustomRenderer/QuizRenderer/QuizARenderer/CodeRender/index.tsx index 29583a33c..9c8b2c25c 100644 --- a/components/Web/LessonPage/PgcCustomRenderer/QuizRenderer/QuizARenderer/CodeRender/index.tsx +++ b/components/Web/LessonPage/PgcCustomRenderer/QuizRenderer/QuizARenderer/CodeRender/index.tsx @@ -1,6 +1,9 @@ import { useQuizARendererContext } from '@/components/ComponentRenderer'; import { WaitingRenderCodeType } from '@/hooks/courses/useParseQuiz'; import React from 'react'; +import message from 'antd/es/message'; +import { CopyIcon } from '@/components/Common/Icon/CopyV2'; +import { BurialPoint } from '@/helper/burialPoint'; interface CodeRenderType { waitingRenderCodes: WaitingRenderCodeType[]; @@ -12,6 +15,22 @@ const CodeRender: React.FC = ({ waitingRenderCodes }) => { }; return (
+
{ + try { + await navigator.clipboard.writeText( + waitingRenderCodes.map((line) => line.content.getRichText()).join('\r\n') + ); + BurialPoint.track('lesson-code复制'); + message.success('Copy success!'); + } catch (e) { + message.warning('The browser version is too low or incompatible!'); + } + }} + > + +
    {waitingRenderCodes.map((line, lineIndex) => (
  • ReactNode; + content: { + getRichText: Function; + }; } const AnswerInputTextarea = (props: { @@ -140,6 +143,12 @@ export const useParseQuiz = (lines: CodeLineType[]) => { /** 错误行 */ const [errorLine, setErrorLine] = useState([]); + const answerStateRef = useRef(answerState); + + useEffect(() => { + answerStateRef.current = answerState; + }, [answerState]); + const codeStyle = useMemo(() => { const bgResetClasses = ['pre[class*="language-"]', 'code[class*="language-"]']; @@ -259,6 +268,19 @@ export const useParseQuiz = (lines: CodeLineType[]) => { ); } }); + }, + content: { + getRichText: () => { + const answers = answerStateRef.current.find((item) => item.id === line.id)?.answers || []; + return rendArr + .map((v, i) => { + const inputId = `${line.id}${i}`; + return v.type === LineType.DEFAULT + ? v.content.join('') + : answers.find((v) => v.id === line.id)?.answers?.find((v) => v.id === inputId)?.inputValue; + }) + .join(''); + } } }; @@ -297,6 +319,11 @@ export const useParseQuiz = (lines: CodeLineType[]) => { }} > ); + }, + content: { + getRichText: () => { + return answerStateRef.current.find((item) => item.id === line.id)?.inputValue; + } } }; return inputLine; @@ -331,6 +358,9 @@ export const useParseQuiz = (lines: CodeLineType[]) => { {line.content} ); + }, + content: { + getRichText: () => line.content } }; @@ -353,6 +383,9 @@ export const useParseQuiz = (lines: CodeLineType[]) => { const waitCodeRenderLines: { type: string; render: (newAnswerState: AnswerState[]) => ReactNode; + content: { + getRichText: Function; + }; }[] = []; for (let i = 0; i < waitLines.length; i++) { let waitLine = waitLines[i]; diff --git a/i18n/client.ts b/i18n/client.ts index 39648dbda..f81e43c4c 100644 --- a/i18n/client.ts +++ b/i18n/client.ts @@ -29,7 +29,6 @@ i18next export function useTranslation(lng: Lang = Lang.EN, ns = TransNs.BASIC, options = {}) { const [cookies, setCookie] = useCookies([cookieName]); const ret = useTranslationOrg(ns as any, options); - // const ret = useTranslationOrg(ns as keyof I18nNamespaces, options); const { i18n } = ret; @@ -52,7 +51,7 @@ export function useTranslation(lng: Lang = Lang.EN, ns = TransNs.BASIC, options useEffect(() => { if (cookies.i18next === lng) return; setCookie(cookieName, lng, { path: '/' }); - }, [lng, cookies.i18next]); + }, [lng]); } return ret; } diff --git a/i18n/config.ts b/i18n/config.ts index 65a8b7819..80ba5cead 100644 --- a/i18n/config.ts +++ b/i18n/config.ts @@ -1,6 +1,6 @@ export enum Lang { - ZH = 'zh', - EN = 'en' + EN = 'en', + ZH = 'zh' } export enum TransNs { @@ -17,7 +17,7 @@ export enum TransNs { AUTH = 'auth' } export const cookieName = 'i18next'; -export const locales = [Lang.ZH, Lang.EN]; +export const locales = [Lang.EN, Lang.ZH]; export const transNs = [ TransNs.BASIC, TransNs.LEARN, diff --git a/middleware.ts b/middleware.ts index b8e7ae294..0caae1c2b 100644 --- a/middleware.ts +++ b/middleware.ts @@ -19,6 +19,7 @@ function getLocale(request: NextRequest): Lang { const languages = new Negotiator({ headers }).languages(); return match(languages, locales, defaultLocale) as Lang; + // return defaultLocale; } export function middleware(request: NextRequest) { diff --git a/service/webApi/resourceStation/index.ts b/service/webApi/resourceStation/index.ts index c04a8965d..eccedb37e 100644 --- a/service/webApi/resourceStation/index.ts +++ b/service/webApi/resourceStation/index.ts @@ -233,8 +233,10 @@ class ResourceStationApi { } /** 注册hackathon */ - registerHackathon(hackathonId: string) { - return this.service.post(`${ResourceStationApiType.Hackathon}/${hackathonId}/members/register`); + registerHackathon(hackathonId: string, data: object = {}) { + return this.service.post(`${ResourceStationApiType.Hackathon}/${hackathonId}/members/register`, { + data + }); } getHackathonPrizeTracks(hackathonId: string) { diff --git a/service/webApi/resourceStation/type.ts b/service/webApi/resourceStation/type.ts index c63bf5809..50ba54932 100644 --- a/service/webApi/resourceStation/type.ts +++ b/service/webApi/resourceStation/type.ts @@ -59,6 +59,7 @@ export interface HackathonType { theme: CustomComponent[]; resources: CustomComponent[]; participants: number; + memberCount: number; hosts: Omit[]; coHosts: Omit[]; startTime: string;