Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

803 advanced organization settings #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rkzel
Copy link

@rkzel rkzel commented Sep 3, 2019

This PR is for extending FE of Settings (recently renamed to Organization) - Tabs, logos, colors, etc. It does not contain integration with IPFS - this will need to be done separately.

@rkzel rkzel changed the base branch from master to settings September 3, 2019 21:14
@chadoh chadoh changed the base branch from settings to master September 4, 2019 16:09
@chadoh chadoh force-pushed the 803-advanced-organization-settings branch from dc5a877 to 9bbb45a Compare September 4, 2019 19:55
Copy link

@chadoh chadoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is coming along nicely! I don't see any big issues, but given that there's a lot of code I saw a bunch of small things we might want to clean up.

@@ -473,7 +473,6 @@ class App extends React.Component {
/>
</div>

<HelpScoutBeacon locator={locator} apps={apps} />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this go away? I don't see it added anywhere else in this PR.

tokenDescription: 'This is a very unethical token.',
tokenAddress: '0x5Fef2867d4BbF1E7423Bb7FB9031402D4F99d2b0',
},
]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this placeholder data 😄

Do we want to ship it like this for now, or is there other work that needs to happen here?

const OpenAppButton = props => <Link css="font-weight: 600" {...props} />

export default Organization
export default props => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In open-enterprise, our linter yells at us if we export anonymous functions like this. The thinking is that anonymous functions aren't as helpful when debugging. Even if the linter in this project doesn't do that, I think it seems nice to follow that rule. Two options for following it:

// option 1
export default function OrganizationWithLayout (props) {
  ...
}

// option 2
const OrganizationWithLayout = props => {
  ...
}
export default OrganizationWithLayout

@@ -265,6 +165,17 @@ Organization.propTypes = {
walletProviderId: PropTypes.string.isRequired,
}

const Section = ({ ...props }) => {
return <Box padding={3 * GU} {...props} />
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote we either:

  1. stop using this; it's only used in two places right now and it's pretty simple
  2. move it to its own file, and use it in all these new components

Option 2 feels a little bit silly, because it's such a small component. On the other hand, it would give us a single place where we could adjust that 3 * GU parameter, if we want to.

I don't know which of these options I prefer.

<p
css={`
${textStyle('body2')}
`}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this didn't change, but since git's diffing tools aren't helpful in showing that, I wonder if now is a good time to simplify this to something like:

<p css={textStyle('body2')}>

<Label text="Placeholder image" />

<div css="margin-bottom: 20px">
<Dropzone onDrop={acceptedFiles => console.log(acceptedFiles)}>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would increase the visibility of this placeholder function if we move it up next to the saveColors definition.

<label
css={`
${textStyle('label2')};
${unselectable()};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why make labels unselectable?

`}
>
{text}
{children && children}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the first value is truthy, the && tells JavaScript to return the second value:

Screen Shot 2019-09-05 at 09 10 07

If the first value is falsey, the && tells JS to return the first value, without even checking the second:

Screen Shot 2019-09-05 at 09 12 14

All this to say: I don't think children && children behaves any differently from just a single children.

<div
css={`
width: ${oneColumn ? '100' : '50'}%;
padding-left: ${oneColumn ? '0' : '20px'};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are definitely ways to accomplish all of this with CSS; no need to rely on JS to tell us if it's one column. I'm not sure if it's worth the effort for now, but it might be a good way to learn some CSS together, @rkzel.

padding-left: ${oneColumn ? '0' : '20px'};
`}
>
<Dropzone onDrop={acceptedFiles => console.log(acceptedFiles)}>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this placeholder function to the top of the component for visibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants