Skip to content

Instantly share code, notes, and snippets.

View surfer19's full-sized avatar

Marián Mrva surfer19

View GitHub Profile

Keybase proof

I hereby claim:

  • I am surfer19 on github.
  • I am majkoo (https://keybase.io/majkoo) on keybase.
  • I have a public key ASCkq5oKvNgqqf70TgF00uUTVCV3LdeTzhYEjUKF_mMzHwo

To claim this, I am signing this object:

@surfer19
surfer19 / index.html
Created September 6, 2019 16:59
Relocista landing page
<h2 class="n1">Nestrácaj</h2>
<h2 class="n2">čas</h2>
<h2 class="n3">hľadaním!</h2>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1920 1080.84">
<defs>
<clipPath id="clip-path">
<rect x="609.64" y="285.74" width="366.84" height="212.04" style="fill: none"/>
</clipPath>
<linearGradient id="linear-gradient" x1="479.07" y1="426.39" x2="525.76" y2="600.63" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#f1c40f"/>
@surfer19
surfer19 / zaitra.io footer
Last active July 24, 2020 13:19
Zaitra footer
import React from "react";
import { useStep } from "react-hooks-helper";
import { Step1 } from "./views/Step1";
import { Step2 } from "./views/Step2";
const steps = [{ id: "step1" }, { id: "step2" }];
export const RegistrationFormStepper = () => {
const { step, navigation } = useStep({ initialStep: 0, steps });
const props = { navigation };
// global-context.jsx
export const GlobalContextProvider = (props) => {
const [state, dispatch] = useReducer(reducer, initialState);
return (
<GlobalContext.Provider value={[state, dispatch]}>
{props.children}
</GlobalContext.Provider>
);
};
@surfer19
surfer19 / example.jsx
Last active September 27, 2020 13:49
<GlobalContextProvider>{…components}</GlobalContextProvider>
// views/Step1.jsx
import React, { useContext, useState } from "react";
import { GlobalContext } from "../context/global-context";
export const Step1 = ({ navigation }) => {
const { next } = navigation;
const [state, dispatch] = useContext(GlobalContext);
const [email, setEmail] = useState(state.email || "");
const [password, setPassword] = useState(state.password || "");
// RegistrationFormStepper.jsx
import React from "react";
import { useStep } from "react-hooks-helper";
import { Step1 } from "./views/Step1";
import { Step2 } from "./views/Step2";
const steps = [{ id: "step1" }, { id: "step2" }];
export const RegistrationFormStepper = () => {
const { step, navigation } = useStep({ initialStep: 0, steps });
@surfer19
surfer19 / App.jsx
Last active September 27, 2020 14:31
// App.jsx
import React from "react";
import "bootstrap/dist/css/bootstrap.min.css";
import "./styles.scss";
import { RegistrationFormStepper } from "./RegistrationFormStepper";
import { GlobalContextProvider } from "./context/global-context";
export default function App() {
return (
<div className="App mt-4">
// views/Step1.jsx
import React from "react";
export const Step1 = ({ navigation }) => {
const { next } = navigation;
const submitForm = () => {
next();
};
return (
<>