Skip to content

Instantly share code, notes, and snippets.

View jossmac's full-sized avatar
Building Keystatic

Joss Mackison jossmac

Building Keystatic
View GitHub Profile
@jossmac
jossmac / withPseudoState.jsx
Last active July 6, 2017 00:22
A higher order component to replace pseudo-states when working with a CSS in JS solution
import React, { Component } from 'react';
export default function withPseudoState(WrappedComponent) {
return class ComponentWithPseudoState extends Component {
actionKeys = ['Enter', ' ']
state = {
isActive: false,
isFocus: false,
isHover: false,
}
@jossmac
jossmac / renderImageSelect.js
Created August 2, 2016 09:20
Temporarily removed the CloudinaryImageField.js renderImageSelect method
renderImageSelect () {
var selectPrefix = this.props.selectPrefix;
var self = this;
var getOptions = function (input, callback) {
// build our url, accounting for selectPrefix
var uri = Keystone.adminPath + '/api/cloudinary/autocomplete';
if (selectPrefix) {
uri = uri + '?prefix=' + selectPrefix;
}