Skip to content

Instantly share code, notes, and snippets.

View cameronolivier's full-sized avatar

Cameron Olivier cameronolivier

View GitHub Profile
@cameronolivier
cameronolivier / ReactComponentRefactor.js
Created August 26, 2020 07:23
ZA Tech - React Component Refactor Example
/* Util Component */
const Optional = ({ condition, Fallback, children }) => (
condition
? {children}
: !!Fallback ? {Fallback} : null //excuse the double ternary - better solved with defaultPropTypes
)
/* Loader Util Component */
const Loader = ({ isLoading, children }) => (
<Optional
@cameronolivier
cameronolivier / basic-css-grid-example.html
Last active June 18, 2019 07:21
Basic CSS Grid Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your First Grid!</title>
</head>
<style>
@cameronolivier
cameronolivier / css-for-basic-grid.css
Last active June 18, 2019 07:18
CSS for a basic grid
.grid {
display:grid;
grid-template-columns: repeat(5, 1fr);
grid-gap: 1rem;
}
Verifying that +cameronolivier is my blockchain ID. https://onename.com/cameronolivier