-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from PotLock/feat/create-project-page
create & edit a project page
- Loading branch information
Showing
24 changed files
with
2,512 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const InfoIcon = (props: any) => { | ||
return ( | ||
<svg {...props} viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
d="M10.0001 13.3327V9.99935M10.0001 6.66602H10.0084M18.3334 9.99935C18.3334 14.6017 14.6025 18.3327 10.0001 18.3327C5.39771 18.3327 1.66675 14.6017 1.66675 9.99935C1.66675 5.39698 5.39771 1.66602 10.0001 1.66602C14.6025 1.66602 18.3334 5.39698 18.3334 9.99935Z" | ||
stroke="#475467" | ||
stroke-width="1.66667" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
/> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default InfoIcon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Container, Description, Heading, Text } from "./styles"; | ||
import InfoIcon from "@app/assets/svgs/InfoIcon"; | ||
|
||
const InfoSegment = ({ title, description }: { title: string; description: string }) => { | ||
const icon = ( | ||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
d="M10.0001 13.3327V9.99935M10.0001 6.66602H10.0084M18.3334 9.99935C18.3334 14.6017 14.6025 18.3327 10.0001 18.3327C5.39771 18.3327 1.66675 14.6017 1.66675 9.99935C1.66675 5.39698 5.39771 1.66602 10.0001 1.66602C14.6025 1.66602 18.3334 5.39698 18.3334 9.99935Z" | ||
stroke="#475467" | ||
stroke-width="1.66667" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
/> | ||
</svg> | ||
); | ||
|
||
return ( | ||
<Container> | ||
<InfoIcon /> | ||
<Text> | ||
<Heading>{title}</Heading> | ||
<Description>{description}</Description> | ||
</Text> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default InfoSegment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Container = styled.div` | ||
box-sizing: border-box; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: flex-start; | ||
padding: 1em; | ||
gap: 0.75em; | ||
background: #fcfcfd; | ||
border: 1px solid #d0d5dd; | ||
border-radius: 4px; | ||
width: 100%; | ||
svg { | ||
width: 20px; | ||
} | ||
`; | ||
|
||
export const Text = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
padding: 0px; | ||
gap: 0.75em; | ||
`; | ||
|
||
export const Heading = styled.div` | ||
font-style: normal; | ||
font-weight: 600; | ||
font-size: 0.95em; | ||
line-height: 1.25em; | ||
color: #344054; | ||
`; | ||
|
||
export const Description = styled.p` | ||
font-style: normal; | ||
font-weight: 400; | ||
font-size: 0.95em; | ||
line-height: 1.25em; | ||
color: #475467; | ||
white-space: wrap; | ||
margin: 0px; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { TypeAhead } from "alem"; | ||
import { Container, Label } from "./styles"; | ||
|
||
type Props = { | ||
label: string; | ||
options: any; | ||
onChange: (selected: any) => void; | ||
placeholder: string; | ||
selected: any; | ||
}; | ||
|
||
const SelectMultiple = (props: Props) => { | ||
const { label, options, onChange, placeholder, selected } = props; | ||
|
||
return ( | ||
<Container> | ||
{label && <Label>{label}</Label>} | ||
<Typeahead | ||
options={options} | ||
multiple | ||
onChange={onChange} | ||
placeholder={placeholder} | ||
// selected={selected} | ||
/> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default SelectMultiple; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: flex-start; | ||
padding: 0px; | ||
gap: 0.45em; | ||
width: 100%; | ||
`; | ||
|
||
export const Label = styled.label` | ||
font-style: normal; | ||
// font-weight: 600; | ||
font-size: 0.95em; | ||
line-height: 1.25em; | ||
color: #344054; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useParams } from "alem"; | ||
import Header from "./components/Header/Header"; | ||
import CreateForm from "./components/CreateForm/CreateForm"; | ||
|
||
const CreateProject = () => { | ||
const { tab } = useParams(); | ||
const edit = tab === "editproject"; | ||
|
||
return ( | ||
<> | ||
<Header | ||
{...{ | ||
title1: edit ? "Edit your project" : "Create new project", | ||
description: `${ | ||
edit ? "Update your " : "Create a " | ||
} profile for your impact project to receive direct donations, qualify for funding rounds, join NEAR's accelerator, and get discovered across social platforms.`, | ||
centered: false, | ||
containerStyle: { | ||
background: "#FEF6EE", | ||
}, | ||
}} | ||
/> | ||
<CreateForm edit={edit} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default CreateProject; |
55 changes: 55 additions & 0 deletions
55
src/pages/CreateProject/components/AccountsStack/AccountsStack.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { useMemo } from "alem"; | ||
import { MoreAccountsContainer, MoreAccountsText, StackContainer } from "./styles"; | ||
import ProfileImage from "@app/components/mob.near/ProfileImage"; | ||
|
||
const AccountsStack = ({ | ||
accountIds, | ||
maxDisplayCount, | ||
sendToBack, | ||
}: { | ||
accountIds: string[]; | ||
maxDisplayCount?: number; | ||
sendToBack: boolean; | ||
}) => { | ||
const MAX_DISPLAY_COUNT = maxDisplayCount || 5; | ||
|
||
const accounts = useMemo(() => accountIds.slice(0, MAX_DISPLAY_COUNT), [accountIds]); | ||
|
||
return ( | ||
<StackContainer> | ||
{accountIds.length > MAX_DISPLAY_COUNT && ( | ||
<MoreAccountsContainer | ||
style={{ | ||
zIndex: accountIds.length + 1, | ||
}} | ||
> | ||
<MoreAccountsText>{MAX_DISPLAY_COUNT}+</MoreAccountsText> | ||
</MoreAccountsContainer> | ||
)} | ||
{accounts.map((accountId: string, idx: number) => { | ||
return ( | ||
<ProfileImage | ||
{...{ | ||
accountId, | ||
style: { | ||
width: "28px", | ||
height: "28px", | ||
zIndex: sendToBack ? 0 : accountIds.length - idx, | ||
margin: "0 -8px 0 0", | ||
border: "2px solid white", | ||
borderRadius: "50%", | ||
background: "white", | ||
}, | ||
className: "mb-2", | ||
imageClassName: "rounded-circle w-100 h-100 d-block", | ||
thumbnail: false, | ||
tooltip: true, | ||
}} | ||
/> | ||
); | ||
})} | ||
</StackContainer> | ||
); | ||
}; | ||
|
||
export default AccountsStack; |
32 changes: 32 additions & 0 deletions
32
src/pages/CreateProject/components/AccountsStack/styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import styled from "styled-components"; | ||
|
||
export const StackContainer = styled.div` | ||
width: 200px; | ||
height: 30px; | ||
margin-bottom: 16px; | ||
display: flex; | ||
flex-direction: row; | ||
@media screen and (max-width: 768px) { | ||
margin-left: 36px; | ||
} | ||
`; | ||
|
||
export const MoreAccountsContainer = styled.div` | ||
width: 28px; | ||
height: 28px; | ||
border: 2px solid white; | ||
border-radius: 50%; | ||
background: #dd3345; | ||
position: relative; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin-right: -8px; | ||
`; | ||
|
||
export const MoreAccountsText = styled.div` | ||
color: white; | ||
font-size: 12px; | ||
font-weight: 600; | ||
text-align: center; | ||
`; |
Oops, something went wrong.