From af8c3b11d6cfb1a282287d825785830214f67108 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Thu, 29 Aug 2024 15:22:41 +0100 Subject: [PATCH] Update UI for shareable link --- .astro/types.d.ts | 1 + .../Projects/SubmitProjectModal.tsx | 23 ++---- .../Projects/SubmitSuccessModal.tsx | 71 ++++--------------- src/components/ReactIcons/FacebookIcon.tsx | 17 +++++ src/components/ReactIcons/LinkedInIcon.tsx | 52 +++++--------- src/components/ReactIcons/ShareIcon.tsx | 4 +- src/components/ReactIcons/TwitterIcon.tsx | 16 ++--- src/data/projects/basic-html-website.md | 53 ++++++++++++++ 8 files changed, 116 insertions(+), 121 deletions(-) create mode 100644 .astro/types.d.ts create mode 100644 src/components/ReactIcons/FacebookIcon.tsx create mode 100644 src/data/projects/basic-html-website.md diff --git a/.astro/types.d.ts b/.astro/types.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/.astro/types.d.ts @@ -0,0 +1 @@ +/// diff --git a/src/components/Projects/SubmitProjectModal.tsx b/src/components/Projects/SubmitProjectModal.tsx index 10df20fb8..6888ad95e 100644 --- a/src/components/Projects/SubmitProjectModal.tsx +++ b/src/components/Projects/SubmitProjectModal.tsx @@ -1,5 +1,4 @@ import { CheckIcon, CopyIcon, X } from 'lucide-react'; -import { CheckIcon as ReactCheckIcon } from '../ReactIcons/CheckIcon.tsx'; import { Modal } from '../Modal'; import { type FormEvent, useState } from 'react'; import { httpPost } from '../../lib/http'; @@ -40,7 +39,7 @@ export function SubmitProjectModal(props: SubmitProjectModalProps) { const { isCopied, copyText } = useCopyText(); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); - const [successMessage, setSuccessMessage] = useState(''); + const [isSuccess, setIsSuccess] = useState(false); const [repoUrl, setRepoUrl] = useState(defaultRepositoryUrl); const [verificationChecks, setVerificationChecks] = useState({ @@ -62,7 +61,7 @@ export function SubmitProjectModal(props: SubmitProjectModalProps) { setIsLoading(true); setError(''); - setSuccessMessage(''); + setIsSuccess(false); if (!repoUrl) { setVerificationChecks({ @@ -199,7 +198,7 @@ export function SubmitProjectModal(props: SubmitProjectModalProps) { ); } - setSuccessMessage('Solution submitted successfully!'); + setIsSuccess(true); setIsLoading(false); onSubmit(submitResponse); @@ -210,14 +209,8 @@ export function SubmitProjectModal(props: SubmitProjectModalProps) { } }; - if (successMessage) { - return ( - - ); + if (isSuccess) { + return ; } return ( @@ -296,12 +289,6 @@ export function SubmitProjectModal(props: SubmitProjectModalProps) { {error && (

{error}

)} - - {successMessage && ( -

- {successMessage} -

- )} - -
- {socialShareLinks.map((socialLink) => ( - - {socialLink.icon} - - ))} -
- -

- Share your solution with the others! -

); diff --git a/src/components/ReactIcons/FacebookIcon.tsx b/src/components/ReactIcons/FacebookIcon.tsx new file mode 100644 index 000000000..e9f88a7d5 --- /dev/null +++ b/src/components/ReactIcons/FacebookIcon.tsx @@ -0,0 +1,17 @@ +interface FacebookIconProps { + className?: string; +} + +export function FacebookIcon(props: FacebookIconProps) { + const { className } = props; + return ( + + + + ); +} \ No newline at end of file diff --git a/src/components/ReactIcons/LinkedInIcon.tsx b/src/components/ReactIcons/LinkedInIcon.tsx index 0c276044d..c2db043fa 100644 --- a/src/components/ReactIcons/LinkedInIcon.tsx +++ b/src/components/ReactIcons/LinkedInIcon.tsx @@ -1,49 +1,29 @@ -type LinkedInIconProps = { +interface LinkedInIconProps { className?: string; -}; +} export function LinkedInIcon(props: LinkedInIconProps) { const { className } = props; - return ( - - - - - - - + + + + + + + ); } diff --git a/src/components/ReactIcons/ShareIcon.tsx b/src/components/ReactIcons/ShareIcon.tsx index 1a75f5316..3745caecb 100644 --- a/src/components/ReactIcons/ShareIcon.tsx +++ b/src/components/ReactIcons/ShareIcon.tsx @@ -1,6 +1,6 @@ -import type { JSX } from "preact/jsx-runtime"; +import type { SVGAttributes } from 'react'; -type ShareIconProps = JSX.SVGAttributes +type ShareIconProps = SVGAttributes; export function ShareIcon(props: ShareIconProps) { return ( diff --git a/src/components/ReactIcons/TwitterIcon.tsx b/src/components/ReactIcons/TwitterIcon.tsx index 59ccb4e71..9297dc141 100644 --- a/src/components/ReactIcons/TwitterIcon.tsx +++ b/src/components/ReactIcons/TwitterIcon.tsx @@ -1,22 +1,22 @@ -type TwitterIconProps = { +interface TwitterIconProps { className?: string; -}; +} export function TwitterIcon(props: TwitterIconProps) { const { className } = props; - return ( + ); diff --git a/src/data/projects/basic-html-website.md b/src/data/projects/basic-html-website.md new file mode 100644 index 000000000..0895bac59 --- /dev/null +++ b/src/data/projects/basic-html-website.md @@ -0,0 +1,53 @@ +--- +title: 'Basic HTML Website' +description: 'Create simple HTML only website with multiple pages.' +isNew: false +sort: 1 +difficulty: 'beginner' +nature: 'HTML' +skills: + - 'HTML' + - 'Layouts' + - 'semantic HTML' +seo: + title: 'Basic HTML Website Project' + description: 'Create a simple HTML only website with multiple pages.' + keywords: + - 'basic html' + - 'html project idea' +roadmapIds: + - 'frontend' +--- + +> Goal of this project is to teach you how to structure a website using HTML i.e. different sections of a website like header, footer, navigation, main content, sidebars etc. Do not style the website, only focus on the structure. Styling will be done in separate projects. + +In this project, you are required to create a simple HTML only website with multiple pages. The website should have following pages: + +- Homepage +- Projects +- Articles +- Contact + +The website should have a navigation bar that should be present on all pages and link to all the pages. + +You are not required to style the website, you are only required to create the structure of the website using HTML. Goals of this project are: + +- Learn how to create multiple pages in a website. +- Structure a website using HTML in a semantic way. +- Structure in a way that you can easily add styles later. +- Add SEO meta tags to the website. + +You can use the following mockup example to create the structure of the website (remember, you are not required to style the website, only focus on the structure that you can style later): + +![Basic HTML Website](https://assets.roadmap.sh/guest/portfolio-design-83lku.png) + +Again, make sure that your submission includes the following: + +- Semantically correct HTML structure. +- Multiple pages with a navigation bar. +- SEO meta tags in the head of each page. +- Contact page should have a form with fields like name, email, message etc. + +
+ +After completing this project, you will have a good understanding of how to structure a website using HTML, basic SEO meta tags, HTML tags, forms etc. You can now move on to the next project where you will learn how to style this website using CSS.