Skip to content

Instantly share code, notes, and snippets.

Avatar
😅
probably fixing a bug

Hugo Duarte fhugoduarte

😅
probably fixing a bug
View GitHub Profile
@fhugoduarte
fhugoduarte / ThemeProvider.tsx
Last active Jun 17, 2021
styled-components integration
View ThemeProvider.tsx
import React, { useMemo } from 'react';
import {
useScreen,
ScreenContextData,
MediaQuery,
BreakpointValues,
rem,
getNearestBreakpointValue,
validateMediaQuery
} from 'responsive-native';
@fhugoduarte
fhugoduarte / useValidateForm.ts
Created Sep 26, 2020
A validation hook to unform 2.0
View useValidateForm.ts
import { FormHandles, SubmitHandler } from '@unform/core';
import { RefObject, useCallback, useState } from 'react';
import { ObjectSchema, ValidationError } from 'yup';
type Hook = <T>(
args: Props<T>,
) => {
validating: boolean;
handleSubmit: SubmitHandler<T>;
};
@fhugoduarte
fhugoduarte / hyper.js
Created Jul 21, 2020
Hyper Config File
View hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
View snippets.json
{
"typescriptFunctionalComponent": {
"prefix": "rfc",
"body": [
"import React from 'react';",
"",
"// import { Container } from './styles';",
"",
"interface Props {",
"",
View settings.json
{
"javascript.suggest.autoImports": true,
"explorer.confirmDelete": false,
"gitlens.codeLens.enabled": false,
"material-icon-theme.folders.associations": {
"subscribers": "messages",
"organisms": "public",
"kube": "kubernetes",
"entities": "class",
"modules": "components",