Skip to content

Instantly share code, notes, and snippets.

View justusromijn's full-sized avatar

Justus Romijn justusromijn

View GitHub Profile
@justusromijn
justusromijn / input.scss
Created February 1, 2021 16:37
Generated by SassMeister.com.
@mixin some-mixin() {
@include button();
text-decoration: none;
&--primary {
color: blue;
@extend %primary;
}
@justusromijn
justusromijn / input.scss
Created February 1, 2021 16:36
Generated by SassMeister.com.
@mixin some-mixin() {
@include button();
text-decoration: none;
&--primary {
// color: red;
@extend %primary;
}
@justusromijn
justusromijn / ButtonBash.test.jsx
Created June 11, 2019 19:26
Smart React Component test
import { shallow } from 'enzyme';
import * as React from 'react';
import { ButtonBash } from './buttonBash';
import { Button } from './button';
describe('<ButtonBash />', () => {
it('renders a button and a bash count', () => {
let component = shallow(<ButtonBash />);
expect(component.contains(<p>Bashes: 0</p>).toBeTruthy();
});
@justusromijn
justusromijn / ButtonBash.jsx
Last active June 11, 2019 19:54
Smart React Component
import * as React, { useState } from 'react';
import { Button } from './button';
export const ButtonBash = () => {
let [count, setCount] = useState(0);
return (
<>
<p>Bashes: {count}</p>
<Button onClick={setCount(count + 1)} label='foo' />
@justusromijn
justusromijn / Button.test.jsx
Created June 11, 2019 18:46
Simple React Button Unit Test
import { mount } from 'enzyme';
import * as React from 'react';
import { Button } from './button';
describe('<Button />', () => {
describe('By default', () => {
let component;
beforeAll(() => {
component = mount(<Button label="foo" />);
});
@justusromijn
justusromijn / Button.jsx
Last active June 12, 2019 09:37
Simple React Button Component
import * as React from 'react';
// Simple Button Component (Dumb)
export const Button = ({ flavour = 'primary', onClick = () => {}, label }) => (
<button onClick={onClick} className={flavour} value={label} />
);
@justusromijn
justusromijn / SassMeister-input-HTML.html
Created December 8, 2015 13:39
Generated by SassMeister.com.
<div class="ng-scope ng-invalid">
<div class="date-picker">yes</div>
</div>