Skip to content

Instantly share code, notes, and snippets.

View GergKllai1's full-sized avatar
🥷

Gergö Kallai GergKllai1

🥷
  • Gothenburg, Sweden
View GitHub Profile
input[name="dob"]:before {
content: "Date of Birth";
color: #aaa;
margin-right: 0.5em;
}
input[name="dob"]:focus:before,
input[name="dob"]:valid:before {
content: "";
}
import React, { lazy, Suspense } from "react";
import { Route, Switch } from "react-router-dom";
import Header from "./components/Header/Header";
import { registerForm, loginForm } from "./UI/Form/formElements";
const Fruits = lazy(() => import("./components/Fruits/Fruits"));
const AuthenticationForm = lazy(() =>
import("./components/AuthenticationForm/AuthenticationForm")
);
import React, { useState } from "react";
import { connect } from "react-redux";
import { withRouter } from "react-router-dom";
import Form from "../../UI/Form/Form";
import {
registerUser,
signInUser
} from "../../store/config/redux-token-auth-config";
@GergKllai1
GergKllai1 / Form.js
Last active September 17, 2019 15:43
import React from "react";
import Input from "../Input/Input";
import Button from "../Button/Button";
import classes from "./Form.module.css";
const Form = ({
formStructure,
formData,
setFormData,
const fields = {
firstName: { type: "text", name: "firstName", text: "First Name", placeholder: 'Jack', required: true },
lastName: { type: "text", name: "lastName", text: "Last Name", placeholder: 'Doe', required: true },
email: { type: "email", name: "email", text: "Email", placeholder: '[email protected]', required: true },
addressLine: { type: "text", name: "addressLine", text: "Address Line", placeholder: 'Awesome str 9', required: true },
postalCode: { type: "text", name: "postalCode", text: "Postal Code", placeholder: '12345', required: true },
city: { type: "text", name: "city", text: "City", placeholder: 'Gothenburg', required: true },
state: { type: "text", name: "state", text: "State", placeholder: 'Gotaland', required: true },
dob: { type: "date", name: "dob", text: "Date of Birth", required: true },
password: { type: "password", name: "password", text: "Password", required: true },
@GergKllai1
GergKllai1 / Button.js
Last active September 17, 2019 14:16
import React from "react";
import classes from "./Button.module.css";
const Button = ({ text, clicked, buttonType }) => {
return (
<>
<button onClick={clicked} className={`${classes.button} ${classes[buttonType]}`}>
{text}
</button>
@GergKllai1
GergKllai1 / Input.js
Last active September 17, 2019 14:01
import React from "react";
import classes from "./Input.module.css";
const Input = ({
text,
type,
placeholder = text,
handleChange,
name,
/// <reference types="Cypress" />
import sessionpage from "../fixtures/sessionpage.js";
describe("User can access videocalls", () => {
it("Coach can start only his own session", () => {
cy.route({
method: "GET",
url: "http://localhost:3000/sessions?page=1",
response: sessionpage({ status: true })
let today = new Date();
const defaults = {
started: true
};
const sessionpage = (payload = defaults) => {
return {
sessions: [
{
/// <reference types="Cypress" />
import sessionpage from "../fixtures/sessionpage.js";
describe("User can access videocalls", () => {
it("Coach can start only his own session", () => {
cy.route({
method: "GET",
url: "http://localhost:3000/sessions?page=1",
response: sessionpage