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

Ida/implement start page #324

Merged
merged 8 commits into from
Dec 3, 2018
Merged

Conversation

idali0226
Copy link
Contributor

No description provided.

@idali0226 idali0226 force-pushed the ida/implement-start-page branch 4 times, most recently from 6611a08 to 0275da5 Compare November 30, 2018 14:05
@@ -0,0 +1,10 @@
module.exports = function capitalizeFirstLetterOfEachWord(string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it's great you add utilities!

Copy link
Contributor

Choose a reason for hiding this comment

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

even if you don't need it for username when you use name instead, we can still keep this utility

return string
}
return string
.toLowerCase()
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we don't have to make everything lowercase. it might be some upper case inside a word that should be preserved, e.g. "GitHub"

return string
.toLowerCase()
.split(' ')
.map(a => a.charAt(0).toUpperCase() + a.substr(1).toLowerCase())
Copy link
Contributor

Choose a reason for hiding this comment

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

module: 'start',
textKey: 'welcome',
})} ${capitalizeFirstLetterOfEachWord(
username
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of username you could use name which we also should have:
screenshot 2018-11-30 10 51 13


class Start extends Component {
render() {
const { i18n: { moduleTranslate }, username } = this.props

return (
<div>
Copy link
Contributor

Choose a reason for hiding this comment

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

use React.Fragment instead

</Segment>
</Grid.Column>
</Grid.Row>
<div className="ui center aligned grid">
Copy link
Contributor

Choose a reason for hiding this comment

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

don't use classNames like this, use the props on Grid instead. textAlign="center".

and maybe this div is not needed

<div className="ui center aligned grid">
<Grid
columns={2}
style={{ marginTop: '6.25em', maxWidth: '60em' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

if you want a maxWidth like this it's better to add the prop container that achieves the same thing.

You should look at those:
https://react.semantic-ui.com/collections/grid/#responsive-variations-container
https://react.semantic-ui.com/elements/container/

In general it would be good if you look more into the Semantic docs so you use the built-in features when possible

style={{
color: '#000000a0',
fontWeight: 200,
lineHeight: '2.5rem',
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can leave this for now, but it's questionable if it has to be this custom styling. This is not reusable, to do so you would have to add it as a custom style for header. But we are short on time and it would make sense to use one of the existing header variations. but we can leave it as it is.

</Button>
</NavLink>
<NavLink to="/app/specimens/mammals">
<Button basic color="blue" size="huge" type="button">
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of basic color="blue" I think you should use basic primary, at least I guess this color should change if we change the color of primary buttons

textKey: 'needHelp',
})}{' '}
<a href="mailto:team@mail.dina-web.net">
dina-collections@nrm.se
Copy link
Contributor

Choose a reason for hiding this comment

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

use the actual email address: team@mail.dina-web.net

what's in the sketch is just an example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a generic contact address setup for dina related issues.

module: 'start',
textKey: 'currentlyVersion',
})}
1.0
Copy link
Contributor

Choose a reason for hiding this comment

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

we're not on version 1.0. if you look in package.json in the root we're "0.5.2" now. what is in the sketch is not always meant literally, here it means to show the current version, not hardcode 1.0 :-)

you will have to get the version from package.json somehow... and that is not trivial, because create-react-app blocks import of anything outside /src unless it's the ui package.json or something symlinked. so we probably need to add a function in common that imports the root package.json and returns the version. maybe I need to help with that

some info in here: facebook/create-react-app#2468
https://stackoverflow.com/questions/44114436/the-create-react-app-imports-restriction-outside-of-src-directory

@idali0226 idali0226 force-pushed the ida/implement-start-page branch 2 times, most recently from ef3a0a1 to 339a6f4 Compare December 3, 2018 10:59
@@ -13,7 +13,11 @@ export const getUser = state => {
return state.user
}

export const getUserName = state => {
Copy link
Contributor

Choose a reason for hiding this comment

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

this line has to be moved to 339a6f4

@fredrikolovsson fredrikolovsson merged commit 3c12b22 into master Dec 3, 2018
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.

2 participants