This file contains hidden or 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
static RadioInput = ({ label, value, name, imgSrc }: RadioInputProps) => ( | |
<RadioImageForm.Consumer> | |
{({ currentValue, onChange }) => ( | |
<label className="radio-button-group" key={value}> | |
<input | |
type="radio" | |
name={name} | |
value={value} | |
aria-label={label} | |
onChange={onChange} |
This file contains hidden or 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
const RadioImageFormContext = React.createContext({ | |
currentValue: '', | |
defaultValue: undefined, | |
onChange: () => { }, | |
}); | |
RadioImageFormContext.displayName = 'RadioImageForm'; |
This file contains hidden or 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
// ... | |
function App() { | |
const [value, setValue] = React.useState(null); | |
const onChange = (value: string): void => { | |
setValue(value); | |
}; | |
return ( | |
<div className="container App"> | |
<Banner |
This file contains hidden or 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
export class RadioImageForm extends React.Component<Probs, State> { | |
// ... | |
render(): React.ReactElement { | |
const { currentValue, onChange, defaultValue } = this.state; | |
return ( | |
<RadioImageFormWrapper> | |
<form> | |
{ | |
React.Children.map(this.props.children, |
This file contains hidden or 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 from 'react' | |
import { render, loop, Rotate } from './tools'; | |
const App = () => ( | |
<svg> | |
<section x="50%" y="50%"> | |
<section width="95%" height="95%"> | |
{ loop( 1, 12, i => | |
<Mark angle={ i * 30 } length={10} /> | |
)} |
This file contains hidden or 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
'CHRIS NG, ALON BUKAI, JESSICA JORDAN, ANNE-GREETH VAN HERWIJNEN, ISAAC LEE, JARED GALANIS, AMY LAM' | |
.split(',') | |
.map(i=>i.toLowerCase() | |
.split(' ') | |
.map(name=>name.charAt(0).toUpperCase() + name.slice(1)) | |
.join(' ')) | |
.join(',') |
This file contains hidden or 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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
filter: 'coo', | |
chores: [ | |
{ name: 'cook', done: true }, | |
{ name: 'clean', done: true }, | |
{ name: 'write more unit tests', done: false } | |
], |
This file contains hidden or 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 EmberRouter from '@ember/routing/router'; | |
import config from './config/environment'; | |
const Router = EmberRouter.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('route-with-loading-state'); |
This file contains hidden or 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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
filterString: '', | |
actions: { | |
changeFilterString(value) { | |
this.set('filterString',value.replace(/\s/g,'')); | |
}, | |
print(){ |
This file contains hidden or 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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
str: '', | |
filterString: Ember.computed('str',{ | |
get(){return 'str'}, | |
set(key, value) {return this.set('str',value.replace(' ')) value} | |
}), | |
actions: { |