Last active
May 2, 2020 13:33
-
-
Save roNn23/ad7175760bd40d5b13b5e6693cc6a6ff to your computer and use it in GitHub Desktop.
components #react
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eslint-disable-next-line react/prop-types | |
const AvailableAddress = ({ address }) => { | |
return ( | |
<AddressStatus address={address} status="isAvailable" /> | |
) | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import AddressForm from '../AddressForm/AddressForm'; | |
import AddressStatus from '../../components/AddressStatus'; | |
import AddressSuggestion from '../../components/AddressSuggestion'; | |
class AvailabilityCheck extends Component { | |
constructor (props) { | |
super(props); | |
this.state = { | |
addressStatus: null, | |
}; | |
} | |
render () { | |
return ( | |
<div className="availability-check background-color--bright"> | |
<h3>Verfügbarkeitsprüfung</h3> | |
<AddressStatus address={this.state.address} status="isNotAvailable" /> | |
<AddressStatus address={this.state.address} status="isAvailable" /> | |
<AddressStatus address={this.state.address} status="isAmbiguous" /> | |
<AddressSuggestion addresses={this.state.addressSuggestions} /> | |
<AddressForm /> | |
</div> | |
); | |
} | |
} | |
export default AvailabilityCheck; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PropTypes from 'prop-types' | |
import React from 'react' | |
import './Component.scss' | |
import classNames from 'classname' | |
const Component = ({ className }) => { | |
const handleOnClick = () => { | |
console.log('Hallo Welt'); | |
} | |
return ( | |
<div className={classNames('comp-component', className)} onClick={handleOnClick}> | |
Hallo Welt | |
</div> | |
) | |
} | |
Component.propTypes = { | |
className: PropTypes.string, | |
} | |
export default Component | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment