Skip to content

Instantly share code, notes, and snippets.

View jamiejohnsonkc's full-sized avatar

Jamie Johnson jamiejohnsonkc

View GitHub Profile
@jamiejohnsonkc
jamiejohnsonkc / linux_cmd.md
Last active March 25, 2021 15:51
Linux CMD #linux #cmd

Linux CMD Notes

action command
open terminal ctrl + alt + T
open app appname
@jamiejohnsonkc
jamiejohnsonkc / foo.jsx
Created November 7, 2020 00:36
Theme-Ui Syntax Examples #Theme-Ui
sx={{
display: ['none', 'none', 'block', 'block', 'block'],
position: 'absolute',
borderRight: (t) => `1px solid ${t.colors.line}`,
top: '33%',
bottom: '33%',
right: 0,
}}
@jamiejohnsonkc
jamiejohnsonkc / Example.jsx
Last active November 3, 2020 17:33
Mapping data within mapped data
/** @jsx jsx */
import { jsx, Box } from 'theme-ui'
import React from 'react'
import PropTypes from 'prop-types'
import ProgressBarGroup from '../ProgressBarGroup/ProgressBarGroup.jsx'
import LabeledProgressBar from '../../../../system/molecules/staticElements/LabeledProgressBar/LabeledProgressBar.jsx'
import Groups from '../progressBarData.js'
const App = ({
groupGridColumns,
@jamiejohnsonkc
jamiejohnsonkc / App.js
Last active November 3, 2020 14:32
Component Mapping Syntax and data format
/** @jsx jsx */
import { jsx, Box } from 'theme-ui'
import React from 'react'
import PropTypes from 'prop-types'
// import ProgressBarGroup from '../ProgressBarGroup/ProgressBarGroup'
import data from './data.js'
import Components from './components'
function App() {
return (
@jamiejohnsonkc
jamiejohnsonkc / accordion.jsx
Created October 31, 2020 03:44
React accordion with animation
/** @jsx jsx */
import { jsx, Box, Text } from 'theme-ui'
import React from 'react'
import PropTypes from 'prop-types'
import './styles.css'
const paragraph =
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Eveniet natus sint provident vel ab reprehenderit cum soluta, suscipit facere nisi sed earum repellendus fuga debitis, nam molestiae minima voluptates possimus.'
const data = [
@jamiejohnsonkc
jamiejohnsonkc / AccordionUl.jsx
Created October 31, 2020 01:03
React Accordion List
import React, { useState, useRef } from 'react'
import styled from 'styled-components'
const Ul = styled.ul`
height: ${({ height }) => height}px;
opacity: ${({ height }) => (height > 0 ? 1 : 0)};
overflow: hidden;
transition: 0.5s;
`
@jamiejohnsonkc
jamiejohnsonkc / AccordionApp.jsx
Last active October 31, 2020 03:28
React animated accordion
/** @jsx jsx */
import { jsx, Box, Text } from 'theme-ui'
import React from 'react'
import PropTypes from 'prop-types'
import './styles.css'
const AccordionElement = ({ title, children }) => {
const [isOpen, setOpen] = React.useState(false)
return (
<div className='accordionWrapper'>
@jamiejohnsonkc
jamiejohnsonkc / emotionStyled.jsx
Last active October 29, 2020 18:06
patterns for styling with emotion #emotion
import styled from '@emotion/styled'
//html element
const Button = styled.button`
color: turquoise;
`
//any component
const Fancy = styled(Basic)`
color: hotpink;
@jamiejohnsonkc
jamiejohnsonkc / concatenateMultipleClassnames.jsx
Last active October 29, 2020 18:06
Concatenate multiple classnes names in #jsx
let combinedClassName = ['className1', 'className2']
combinedClassName = combinedClassName.join(' ')
//
<Component className='combinedClassName'
@jamiejohnsonkc
jamiejohnsonkc / SimpleUlList.jsx
Last active August 25, 2020 19:33
Simple Dynamic List via mapping
/** @jsx jsx */
import { jsx } from 'theme-ui'
import React from 'react'
const list = ['a', 'b', 'c']
const SimpleUlList = () => (
<ul>
{list.map((item) => (
<li key={item}>{item}</li>