Skip to content

Instantly share code, notes, and snippets.

View KevinVR's full-sized avatar
💻
Always Coding

Kevin Van Ryckegem KevinVR

💻
Always Coding
View GitHub Profile
image: node:latest
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
pages:
script:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListObjectsInBucket",
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "cloudfront:CreateInvalidation",
"Resource": "arn:aws:cloudfront:::distribution/<REPLACE_WITH_DISTRIBUTION_ID>"
}
]
// Text.module.css
.custom-text {
color: red;
font-size: 20px;
}
// Text.jsx
import TextStyles from './Text.module.css';
import styled from 'styled-components';
import Text from './Text.jsx';
function MyComponent() {
const BigRedText = styled(Text)`
font-size: 40px;
color: red;
`;
return <BigRedText>
function MyComponent() {
return <div styles={{
backgroundColor: 'red',
fontSize: '25px'
}}>
...
</div>;
}
@KevinVR
KevinVR / react-classname.jsx
Created August 15, 2021 12:25
Simple className React
function MyComponent() {
return <div className="container">
...
</div>;
}
import React, { useState } from 'react';
const LightBox = ({ children, src, alt, Wrapper = 'div', zIndex = 100 }) => {
const [isOpen, setIsOpen] = useState(false);
const toggleIsOpen = () => {
setIsOpen(!isOpen);
};
return (
import React, {useState} from 'react';
const LightBox = ({ children, src, alt, Wrapper = 'div' }) => {
const [isOpen, setIsOpen] = useState(false);
const toggleIsOpen = () => {
setIsOpen(!isOpen);
};
return (
import React, {useState} from 'react';
const LightBox = ({ children, src, alt, Wrapper = 'div' }) => {
const [isOpen, setIsOpen] = useState(false);
const toggleIsOpen = () => {
setIsOpen(!isOpen);
};
return (