Skip to content

Instantly share code, notes, and snippets.

@carl0zen
Last active December 2, 2015 18:50
Show Gist options
  • Save carl0zen/b1711c6efa2c0cefe02f to your computer and use it in GitHub Desktop.
Save carl0zen/b1711c6efa2c0cefe02f to your computer and use it in GitHub Desktop.
#/bin/sh
# author: perezpriego
# This shell script creates the basic architecture of a react-component
mkdir -p $1
cd $1
touch styles.scss index.jsx
cat > index.jsx <<DELIM
import React from "react";
import styles from "./style";
class $1 extends React.Component {
render() {
return (
<div className={styles.root}>
$1
</div>
);
}
}
$1.displayName = $1.name;
export default $1;
DELIM
cat > styles.scss <<DELIM
@import "../../paint-settings.scss";
:local(.root) {
border: 1px solid red; //for testing purposes
}
DELIM
"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment