Skip to content

Commit

Permalink
Merge branch 'lambda-dao' into max-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Man-Jain authored Oct 31, 2022
2 parents cf4f77e + 3a734f1 commit 9ca0369
Show file tree
Hide file tree
Showing 56 changed files with 5,827 additions and 173 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@taquito/tzip12": "13.0.1",
"@taquito/tzip16": "13.0.1",
"@types/mixpanel-browser": "^2.35.7",
"@types/prismjs": "^1.26.0",
"bignumber.js": "^9.0.1",
"blockies-ts": "^1.0.0",
"dayjs": "^1.10.4",
Expand All @@ -41,6 +42,8 @@
"launchdarkly-react-client-sdk": "2.27.0",
"mixpanel-browser": "^2.42.0",
"notistack": "^1.0.3",
"prism-themes": "^1.9.0",
"prismjs": "^1.28.0",
"react": "^17.0.1",
"react-customizable-progressbar": "^1.0.2",
"react-dom": "^17.0.2",
Expand All @@ -51,6 +54,7 @@
"react-query": "^3.13.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-simple-code-editor": "^0.11.2",
"react-spring-bottom-sheet": "^3.4.0",
"rehype-raw": "^6.1.1",
"remark-breaks": "^3.0.2",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/img/lambda.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/modules/common/BackButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react"
import { Box, styled } from "@material-ui/core"
import { ArrowBack } from "@material-ui/icons"

const BackIcon = styled(ArrowBack)({
cursor: "pointer",
width: "18px",
color: "#ffff",
marginTop: "-5px"
})

export const CloseButton: React.FC<{ onGoBack?: () => void }> = ({ onGoBack }) => {
return (
<Box onClick={onGoBack}>
<BackIcon />
</Box>
)
}

export default CloseButton
3 changes: 2 additions & 1 deletion src/modules/common/ChangeNetworkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const StyledConnectedButton = styled(Box)(({ theme }: { theme: Theme }) => ({

export const networkDotColorMap: Record<Network, string> = {
mainnet: "#9EEE5D",
ghostnet: "#291F79"
ghostnet: "#291F79",
kathmandunet: "#271F71"
}

export const ColorDot = styled(Box)({
Expand Down
4 changes: 2 additions & 2 deletions src/modules/common/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const CopyIcon = styled(FileCopyOutlined)({
cursor: "pointer"
})

export const CopyButton: React.FC<{ text: string }> = ({ text }) => {
export const CopyButton: React.FC<{ text: string; style?: any }> = ({ text, style }) => {
const [copied, setCopied] = useState(false)
return (
<Box
Expand All @@ -22,7 +22,7 @@ export const CopyButton: React.FC<{ text: string }> = ({ text }) => {
}, 2000)
}}
>
<Tooltip placement="bottom" title={!copied ? "Copy to Clipboard" : "Copied!"}>
<Tooltip style={style} placement="bottom" title={!copied ? "Copy to Clipboard" : "Copied!"}>
<CopyIcon color="secondary" fontSize="small" />
</Tooltip>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/creator/state/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface NavigationBarProps {
}
}

export type DAOTemplate = "treasury" | "registry" | ""
export type DAOTemplate = "treasury" | "registry" | "lambda" | ""

type DeploymentStatus = {
deploying: boolean
Expand Down
54 changes: 51 additions & 3 deletions src/modules/creator/steps/Template.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Grid, styled, Typography, Box, useMediaQuery, useTheme, makeStyles } from "@material-ui/core"
import React, { useContext, useEffect, useState } from "react"
import { useHistory, withRouter } from "react-router"
import { ReactComponent as LambdaIcon } from "assets/img/lambda.svg"

import { AccountBalance, FormatListBulleted } from "@material-ui/icons"
import { ActionTypes, CreatorContext, DAOTemplate } from "modules/creator/state"
Expand All @@ -13,23 +14,47 @@ const CustomBox = styled(Grid)(({ theme }) => ({
"borderRadius": 8,
"maxWidth": 320,
"width": "-webkit-fill-available",
"padding": "40px 50px",
"padding": "40px 44px",
"textAlign": "start",
"cursor": "pointer",
"paddingBottom": 0,
"&:hover": {
border: "3px solid rgba(129, 254, 183, 0.4)",
padding: "37px 47px"
padding: "37px 41px"
},
["@media (max-width:1167px)"]: {
marginBottom: 20
}
}))

const LambdaCustomBox = styled(Grid)(({ theme }) => ({
"height": 273,
"marginTop": 30,
"background": "#2F3438",
"borderRadius": 8,
"maxWidth": 320,
"width": "-webkit-fill-available",
"padding": "40px 44px",
"textAlign": "start",
"cursor": "pointer",
"paddingBottom": 0,
"&:hover": {
border: "3px solid rgba(129, 254, 183, 0.4)",
paddingTop: 37,
paddingBottom: 0,
paddingRight: 41,
paddingLeft: 41
},
["@media (max-width:1167px)"]: {
marginBottom: 20,
marginTop: 0
}
}))

const styles = makeStyles({
selected: {
border: "3px solid rgba(129, 254, 183, 0.4)",
padding: "37px 47px"
padding: "37px 41px"
}
})

Expand All @@ -54,6 +79,13 @@ const CustomList = styled(FormatListBulleted)(({ theme }) => ({
marginBottom: 16
}))

const Lambda = styled(LambdaIcon)(({ theme }) => ({
width: 64,
height: 64,
color: theme.palette.secondary.light,
marginBottom: 16
}))

const BoxTitle = styled(Typography)({
fontSize: 18,
fontWeight: 500,
Expand Down Expand Up @@ -144,6 +176,22 @@ export const Template = (): JSX.Element => {
Govern arbitrary smart contracts, curate marketplaces, and more
</BoxDescription>
</CustomBox>{" "}
<LambdaCustomBox
item
container
direction="column"
justifyContent="flex-start"
alignItems="center"
xs={isMobileSmall ? 12 : 6}
onClick={() => update("lambda")}
className={selectedTemplate === "lambda" ? style.selected : ""}
>
<Lambda />
<BoxTitle color="textSecondary">Lambda</BoxTitle>
<BoxDescription color="textSecondary">
Safe with multi-sig. List of key-value pairs. Contract interaction.
</BoxDescription>
</LambdaCustomBox>{" "}
</Grid>
{error ? <ErrorText>{"Must select a template in order to continue"}</ErrorText> : null}
</Box>
Expand Down
3 changes: 2 additions & 1 deletion src/modules/explorer/components/ChangeNetworkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const StyledConnectedButton = styled(Box)(({ theme }: { theme: Theme }) => ({

export const networkDotColorMap: Record<Network, string> = {
mainnet: "#9EEE5D",
ghostnet: "#291F79"
ghostnet: "#291F79",
kathmandunet: "#271F71"
}

export const ColorDot = styled(Box)({
Expand Down
5 changes: 2 additions & 3 deletions src/modules/explorer/components/ConfigProposalForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ export const ConfigProposalForm: React.FC<Props> = ({ open, handleClose }) => {
</ProposalFormInput>
</Grid>
<Grid item>
<ProposalFormInput
label={`Percentage of tokens returned after rejection (Current: ${dao?.data.extra.returnedPercentage.toString()}%)`}
>
{/* <ProposalFormInput label={`Percentage of tokens returned after rejection (Current: ${dao?.data.extra.returnedPercentage.toString()}%)`}> */}
<ProposalFormInput label={`Percentage of tokens returned after rejection (Current:`}>
<Controller
control={methods.control}
name={`returnedPercentage`}
Expand Down
Loading

0 comments on commit 9ca0369

Please sign in to comment.