What framework to use? How to manage state? How to fetch data? Which router to use? Which calendar component to use? Which chart component to use? ... !
What framework to use? How to manage state? How to fetch data? Which router to use? Which calendar component to use? Which chart component to use? ... !
What framework to use? How to manage state? How to fetch data? Which router to use? Which calendar component to use? Which chart component to use? ... !
// components/Time/index.js import * as React from 'react'; import classNames from 'classNames'; import styles from './styles.css'; import moment from 'moment'; import FancyTime from 'fancy-time'; export default function Time({ className, time }) { return ( className={className(styles.time, className)} datetime={moment(time).format()}> {moment(time).format('HH:mm')}
// components/Time/index.js import * as React from 'react'; import classNames from 'classNames'; import styles from './styles.css'; import { formatTime } from './utils'; import FancyTime from 'fancy-time'; export default function Time({ className, time }) { return ( className={className(styles.time, className)} datetime={formatTime('full'}> {formatTime('clock')}
); } // components/Time/utils.js import moment from 'moment'; const FORMATS = { 'full': null, 'clock': 'HH:mm', }; export function formatTime(time, kind) { const format = FORMATS[kind] return moment(time).format(format); }
// pages/Home/index.js import * as React from 'react'; import { Jumbotron } from 'react-bootstrap'; import { Link } from 'react-router'; import styles from './styles.css'; import globalStyles from 'styles/global.css'; import classNames from 'classNames'; import Time from 'components/Time'; import Clock from 'components/Clock'; export default class Page extends React.Component { render() { return (
// pages/Home/index.js import * as React from 'react'; import { Jumbotron } from 'react-bootstrap'; import { Link } from 'react-router'; import styles from './styles.css'; import globalStyles from 'styles/global.css'; import classNames from 'classNames'; import Time from 'components/Time'; import Clock from 'components/Clock'; export default class Page extends React.Component { render() { return (
// pages/Home/index.js import * as React from 'react'; import { Link } from 'react-router'; import Time from 'components/Time'; import Clock from 'components/Clock'; import Jumbotron from 'components/Jumbotron'; export default function Page() { return (
// pages/Home/index.js import * as React from 'react'; import { Link } from 'react-router'; import paths from 'paths'; import Time from 'components/Time'; import Clock from 'components/Clock'; import Jumbotron from 'components/Jumbotron'; export default function Page() { return (
// pages/Home/index.js import * as React from 'react'; import { Link } from 'react-router'; import paths from 'paths'; import Time from 'components/Time'; import Clock from 'components/Clock'; import Jumbotron from 'components/Jumbotron'; export default function Page() { return (