Skip to content

Instantly share code, notes, and snippets.

🤗
We are hiring at @smooth-code

Greg Bergé neoziro

🤗
We are hiring at @smooth-code
Block or report user

Report or block neoziro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ex-11-hooks.js
// App.js
import React, { useState, useEffect, useRef } from 'react'
import {
Normalize,
Grid,
Typography,
Row,
Col,
Button,
} from '@smooth-ui/core-sc'
View after.js
import React from 'react'
import styled, { Box, css, variant } from '@xstyled/styled-components'
const variants = variant({
variants: {
gold: css`
background-color: gold;
color: white;
border-color: gold;
`,
View prepass.js
import React, { useContext } from 'react'
import ReactDOM from 'react-dom/server'
import ssrPrepass from 'react-ssr-prepass'
const Context = React.createContext()
const asyncFoo = async () => 'foo'
function MyComponent() {
const tracker = useContext(Context)
View About.js
import React, { useState, useEffect } from 'react'
import { createPortal } from 'react-dom'
import styled from 'styled-components'
const Backdrop = styled.div`
position: absolute;
background-color: rgba(0, 0, 0, 0.5);
top: 0;
right: 0;
bottom: 0;
@neoziro
neoziro / system-props.js
Created Mar 8, 2019
Smooth UI - System props
View system-props.js
import { Box } from "@smooth-ui/core-sc";
<Box
backgroundColor="primary"
width={{ sm: 1, md: 0.5 }}
height={100}
mx="auto"
p={2}
/>
@neoziro
neoziro / system-component.js
Last active Mar 8, 2019
Smooth UI System - Component
View system-component.js
import styled from "styled-components";
import system from "@smooth-ui/system";
const MyBox = styled.div(
system({
backgroundColor: 'primary',
width: { sm: 1, md: 0.5 },
height: 100,
mx: 'auto',
p: 2,
View Countdown.js
import { useState, useEffect } from 'react'
export const useCountdown = ({ initialValue, delay }) => {
const [value, setValue] = useState(initialValue)
useEffect(() => {
if (value > 0) setTimeout(() => setValue(value - 1), delay)
})
return value
}
@neoziro
neoziro / ArticleCard.js
Last active May 24, 2018
FraQL preview 👌
View ArticleCard.js
import React from 'react'
import gql from 'fraql'
const ArticleCard = ({ article }) => (
<div>
<h1>{article.title}</h1>
<p>{article.description}</p>
</div>
)
View ReferenceManyToManyInput.js
/* eslint-disable react/no-multi-comp, react/no-unused-state */
import React from 'react'
import { connect } from 'react-redux'
import * as ReactAdmin from 'react-admin'
import { createSelector } from 'reselect'
import { Field, arrayRemove, arrayPush } from 'redux-form'
import { CircularProgress } from 'material-ui/Progress'
import Table, {
TableBody,
TableCell,
@neoziro
neoziro / .babelrc
Created Dec 12, 2017
React boilerplate using Parcel
View .babelrc
{ "presets": ["env", "react"] }
You can’t perform that action at this time.