Skip to content

Commit

Permalink
merged develop changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiolalombardim committed Jul 28, 2023
2 parents 1d5396e + 5ff5106 commit ca858fd
Show file tree
Hide file tree
Showing 46 changed files with 1,457 additions and 596 deletions.
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing to tezos homebase

Thank you for your interest in contributing to tezos homebase, a web app that allows anyone to create and manage DAOs on Tezos. We welcome and appreciate any contributions, whether it is code, documentation, design, feedback, or ideas.


## How to contribute

There are many ways you can contribute to our project:

- Report bugs or suggest features by opening an [issue](https://github.com/dOrgTech/homebase-app/issues).
- Fix bugs or implement features by submitting a [pull request](https://github.com/dOrgTech/homebase-app/pulls).
- Improve the documentation or the user interface by editing the files directly on GitHub or forking the repo.
- Join our [Discord server](https://discord.gg/9cduRr5) and chat with us about the project.

## Development setup

To set up your local development environment, follow these steps:

1. Fork and clone the repo: `git clone https://github.com/<your-username>/homebase-app.git`
2. Install the dependencies: `yarn install`
3. Create a `.env` file in the root directory and add the required environment variables (see `.env.example` for reference)
4. Run the app in development mode: `yarn start`
5. Open http://localhost:3000 to view the app in the browser

## Pull request guidelines

Before you submit a pull request, please make sure that:

- Your code follows the [Prettier](https://prettier.io/) code style and format
- Your code passes the [ESLint](https://eslint.org/) checks and has no errors or warnings
- Your code is well-tested and has good coverage
- Your code is documented with comments and JSDoc annotations
- Your commit messages are clear and descriptive
- Your branch is up-to-date with the `develop` branch

To submit a pull request, follow these steps:

1. Create a new branch from the `develop` branch: `git checkout -b <branch-name>`
2. Make your changes and commit them: `git commit -m "<commit-message>"`
3. Push your branch to your fork: `git push origin <branch-name>`
4. Go to https://github.com/dOrgTech/homebase-app and create a new pull request from your branch to the `develop` branch
5. Fill out the pull request template and wait for a review

## Review process

We will review your pull request as soon as possible and provide feedback or suggestions if needed. We may ask you to make some changes before we merge your pull request. Please be patient and respectful with us and other contributors.

Thank you for reading this guide and for contributing to tezos homebase!
9 changes: 2 additions & 7 deletions src/assets/img/lite-dao.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/img/managed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/img/self-deployed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 20 additions & 10 deletions src/modules/common/ChangeNetworkButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Box, capitalize, Grid, styled, Typography, Theme } from "@material-ui/core"
import { ActionSheet, useActionSheet } from "modules/explorer/context/ActionSheets"
import React from "react"
import { useLocation } from "react-router-dom"
import { Network } from "services/beacon"
import { useTezos } from "services/beacon/hooks/useTezos"

Expand Down Expand Up @@ -41,16 +42,25 @@ export const ChangeNetworkButton = () => {
const { network } = useTezos()
const { open } = useActionSheet(ActionSheet.Network)

const location = useLocation()

const canShow =
location.pathname.indexOf("/explorer/dao/") === -1 && location.pathname.indexOf("/explorer/lite/dao/") === -1

return (
<StyledConnectedButton onClick={() => open()}>
<Grid container style={{ gap: 5 }} alignItems="center" wrap="nowrap">
<Grid item>
<ColorDot color={networkDotColorMap[network]} />
</Grid>
<Grid item>
<NetworkText>{capitalize(network)}</NetworkText>
</Grid>
</Grid>
</StyledConnectedButton>
<>
{canShow ? (
<StyledConnectedButton onClick={() => open()}>
<Grid container style={{ gap: 5 }} alignItems="center" wrap="nowrap">
<Grid item>
<ColorDot color={networkDotColorMap[network]} />
</Grid>
<Grid item>
<NetworkText>{capitalize(network)}</NetworkText>
</Grid>
</Grid>
</StyledConnectedButton>
) : null}
</>
)
}
2 changes: 2 additions & 0 deletions src/modules/common/SmallButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export const SmallButton = styled(Button)({
"transition": ".15s ease-out",
"textTransform": "capitalize",
"borderRadius": 8,
"backgroundColor": "#81feb7 !important",
"color": "#1c1f23",

"&$disabled": {
boxShadow: "none"
Expand Down
30 changes: 16 additions & 14 deletions src/modules/common/TitleBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Grid, Paper, styled, Tooltip, Typography } from "@material-ui/core"
import { Grid, Link, Paper, styled, Tooltip, Typography } from "@material-ui/core"
import React from "react"
import { ReactElement } from "react-markdown/lib/react-markdown"
import { InfoRounded } from "@material-ui/icons"
Expand All @@ -7,14 +7,9 @@ import { CopyButton } from "./CopyButton"

const StyledGrid = styled(Grid)({
height: "fit-content",
background: "#2F3438",
borderRadius: 8,
padding: "30px 40px",
marginBottom: 38
})

const CustomTypography = styled(Typography)({
marginTop: 27
padding: "0",
gap: 16
})

const CustomTooltip = styled(Tooltip)({
Expand All @@ -33,7 +28,7 @@ const InfoIconInput = styled(InfoRounded)(({ theme }) => ({
}))

const CustomTooltipText = styled(Typography)({
fontSize: 12,
fontSize: 14,
marginLeft: 2
})

Expand All @@ -50,9 +45,16 @@ interface Props {
description: ReactElement | string
tooltip?: boolean
tooltipText?: string
tooltipLink?: string
}

export const TitleBlock: React.FC<Props> = ({ title = "", description, tooltip = false, tooltipText = "" }) => {
export const TitleBlock: React.FC<Props> = ({
title = "",
description,
tooltip = false,
tooltipText = "",
tooltipLink = ""
}) => {
return (
<StyledGrid container direction="row" justifyContent="space-between">
<Grid item xs={12} container direction="row" alignItems="flex-end">
Expand All @@ -66,9 +68,9 @@ export const TitleBlock: React.FC<Props> = ({ title = "", description, tooltip =
<CustomTooltip placement="bottom" title={description}>
<InfoIconInput />
</CustomTooltip>
<HashLink smooth to="/faq#how-to-create-a-dao-on-homebase" target={"_blank"}>
<Link target="_blank" href={`https://faq.tezos-homebase.io/homebase-faq/${tooltipLink}`} color="secondary">
<CustomTooltipText color="secondary">{tooltipText} </CustomTooltipText>
</HashLink>
</Link>
</CustomTextContainer>
) : null}
</Grid>
Expand All @@ -79,9 +81,9 @@ export const TitleBlock: React.FC<Props> = ({ title = "", description, tooltip =
{description}
</Typography>
) : description ? (
<CustomTypography variant="subtitle1" color="textSecondary">
<Typography variant="subtitle1" color="textSecondary">
{description}
</CustomTypography>
</Typography>
) : null}
</Grid>
<Grid item xs={12}></Grid>
Expand Down
15 changes: 9 additions & 6 deletions src/modules/creator/components/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from "react"
import { ArrowBackIos } from "@material-ui/icons"

import { NavigationBarProps } from "modules/creator/state"
import { MainButton } from "modules/common/MainButton"

const Footer = styled(Grid)(({ theme }) => ({
background: theme.palette.primary.main,
Expand All @@ -27,14 +28,12 @@ const BackButton = styled(Paper)({
width: "fit-content"
})

const NextButton = styled(Paper)(({ theme }) => ({
boxShadow: "none",
borderRadius: 4,
const NextButton = styled(MainButton)(({ theme }) => ({
textAlign: "center",
float: "right",
cursor: "pointer",
background: theme.palette.secondary.light,
padding: 8
padding: "8px 16px"
}))

const BackButtonIcon = styled(ArrowBackIos)(({ theme }) => ({
Expand All @@ -58,14 +57,18 @@ export const NavigationBar: React.FC<NavigationBarProps> = ({ back, next }) => {
{back && (
<BackButton onClick={back.handler}>
<BackButtonIcon />
<Typography color="secondary">{back.text}</Typography>
<Typography style={{ fontWeight: 500 }} color="secondary">
{back.text}
</Typography>
</BackButton>
)}
</Grid>
<Grid item xs={6}>
{next && (
<NextButton onClick={next.handler}>
<Typography color="primary">{next.text}</Typography>
<Typography style={{ fontWeight: 500 }} color="primary">
{next.text}
</Typography>
</NextButton>
)}
</Grid>
Expand Down
3 changes: 3 additions & 0 deletions src/modules/creator/deployment/steps/Distribution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ const validateForm = (values: TokenDistributionSettings) => {
if (values.totalAmount && values.totalAmount.minus(new BigNumber(getTotal(values.holders))) < new BigNumber(0)) {
errors.totalAmount = "Available balance has to be greater that the total supply"
}
if (values.totalAmount && values.totalAmount.gt(new BigNumber(getTotal(values.holders)))) {
errors.totalAmount = "Total Supply not fully allocated"
}
})

return errors
Expand Down
15 changes: 3 additions & 12 deletions src/modules/creator/deployment/steps/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const ContractSummary: React.FC = () => {
}

const {
mutation: { mutate, data, error }
mutation: { mutate, data }
} = useTokenOriginate(state.data)

useEffect(() => {
Expand All @@ -107,19 +107,10 @@ export const ContractSummary: React.FC = () => {
type: ActionTypes.CLEAR_CACHE
})
history.push("/creator/success", { address: data.address })
}
}, [data, dispatch, history])

useEffect(() => {
if (error) {
} else if (data && !data.address) {
setIsLoading(false)
openNotification({
message: "Error deploying token... try again later",
variant: "error",
autoHideDuration: 2000
})
}
}, [error, openNotification])
}, [data, dispatch, history])

useEffect(() => {
dispatch({
Expand Down
Loading

0 comments on commit ca858fd

Please sign in to comment.