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

Ndlano/issue#474 lydvelger som egen pakke #76

Merged
merged 27 commits into from
Aug 7, 2017

Conversation

sirhaug
Copy link

@sirhaug sirhaug commented Jul 25, 2017

No description provided.

return (
<div {...classes()}>
<audio autoPlay controls onPlay={!audioSource && this.loadAudio}>
{' '}{audioSource}
Copy link
Contributor

Choose a reason for hiding this comment

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

Hvorfor {' '}{audioSource} ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Med state endringen ovenfor kan du ta ha

<source src={this.state.src} type={this.state.type} />

}

AudioComponent.propTypes = {
audio: PropTypes.object.isRequired,
Copy link
Contributor

Choose a reason for hiding this comment

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

PropTypes.shape her.

constructor(props) {
super(props);
this.state = {
queryObject: this.props.queryObject,
Copy link
Contributor

Choose a reason for hiding this comment

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

bare props, ikke this.props


return (
<div {...classes('form')}>
<select onChange={this.handleLanguageChange}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Tror ikke vi burde ha det her. Dette er noe som bestemmes av locale som blir sendt inn av den frontenden som bruker denne pakken.

}

AudioSearchForm.propTypes = {
queryObject: PropTypes.object,
Copy link
Contributor

Choose a reason for hiding this comment

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

Proptypes.shape her også.

};

AudioSearchForm.defaultProps = {
query: '',
Copy link
Contributor

Choose a reason for hiding this comment

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

Er query en prop? Ser den ikke i valideringen i hvertfall

import BEMHelper from 'react-bem-helper';
import { getLicenseByAbbreviation } from 'ndla-licenses';
import { Button, LicenseIconList } from 'ndla-ui';

Copy link
Contributor

Choose a reason for hiding this comment

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

kan fjerne emptyline her

prefix: 'c-',
});

class AudioSearchResult extends Component {
Copy link
Contributor

@chrpeter chrpeter Jul 25, 2017

Choose a reason for hiding this comment

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

Her håndterer du ingen komponent state eller bruker noen livsyklus metoder så denne kan være en stateless component, feks slik

const AudioSearchResult = (props) => {
  return (
    <div key={audio.id} {...classes('list-item', 'search-result')}>
      //resten her
    </div>
  )
}


@import "global/settings/settings.config";
@import "global/settings/settings.colors";
$xxlarge-viewport-max: "max-width: 1400px)";
Copy link
Contributor

Choose a reason for hiding this comment

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

Disse viewportsa trenger du ikke hvis du ikke skal bruke dem.

.fetchAudio(this.props.audio.id)
.then(result => {
this.setState({
audioSource: (
Copy link
Contributor

Choose a reason for hiding this comment

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

Her ville jeg heller ha satt

this.setState({src: result.audioFile.url, type: result.audioFile.mimeType});

og brukt dette i source taggen lenger ned.

@chrpeter
Copy link
Contributor

Har lagt inn en del kommentarer nå. Det er også fint om du kan lage README.md.

},
"dependencies": {
"defined": "1.0.0",
"react-bem-helper": "^1.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Trengs vel bare som devDep.

Copy link
Contributor

@chrpeter chrpeter left a comment

Choose a reason for hiding this comment

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

Se kommentarer


// The 'audio' tag is implemented with a download button in Chrome > 58.
// Make it so that this button doesn't show.
audio::-webkit-media-controls {
Copy link
Contributor

Choose a reason for hiding this comment

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

Dette vil jo bare funke på webkit støtta browsere da?

import BEMHelper from 'react-bem-helper';

const classes = new BEMHelper({
name: 'audio-component',
Copy link
Contributor

Choose a reason for hiding this comment

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

prefix c står for component, så ville heller hatt audio-preview eller noe sånt i stedet.

"ndla-licenses": "^0.0.7",
"ndla-ui": "^0.7.4",
"ndla-util": "^0.1.3",
"defined": "1.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

defined må være dependency.

padding-left: 0;
padding-right: 0;
margin-bottom: 1em;
padding-bottom: 1em;
Copy link
Contributor

Choose a reason for hiding this comment

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

rem isteden for em.

@oyvinmar oyvinmar merged commit 84fd204 into master Aug 7, 2017
@oyvinmar oyvinmar deleted the NDLANO/Issue#474-Lydvelger-som-egen-pakke branch August 7, 2017 09:39
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.

3 participants