- implement lists

- implement generic sections
- implement list actions
- implement error handlers
This commit is contained in:
Amruth Pillai
2020-07-08 05:01:50 +05:30
parent d7e86ddf29
commit bee6a40e9f
38 changed files with 762 additions and 177 deletions
+5 -2
View File
@@ -1,15 +1,18 @@
import cx from "classnames";
import React, { useContext } from "react";
import { toUrl } from "gatsby-source-gravatar";
import React, { useContext, useMemo } from "react";
import UserContext from "../../contexts/UserContext";
import styles from "./Avatar.module.css";
const Avatar = ({ className }) => {
const { user } = useContext(UserContext);
const photoURL = useMemo(() => toUrl(user.email, "size=128"), [user.email]);
return (
<img
className={cx(styles.container, className)}
src={user.photoURL}
src={photoURL}
alt={user.displayName}
/>
);
+2 -3
View File
@@ -1,5 +1,6 @@
import classNames from "classnames";
import React from "react";
import { handleKeyDown } from "../../utils";
import styles from "./Button.module.css";
const Button = ({
@@ -16,13 +17,11 @@ const Button = ({
[styles.outline]: outline,
});
const handleKeyDown = () => {};
return (
<button
type={type}
className={classes}
onKeyDown={handleKeyDown}
onKeyDown={(e) => handleKeyDown(e, onClick)}
onClick={isLoading ? undefined : onClick}
>
{icon && <Icon size="14" className="mr-2" />}
+6 -1
View File
@@ -11,6 +11,9 @@ const Input = ({
label,
value,
error,
onBlur,
touched,
checked,
onChange,
className,
placeholder,
@@ -41,11 +44,13 @@ const Input = ({
name={name}
type={type}
value={value}
onBlur={onBlur}
checked={checked}
onChange={onChange}
placeholder={placeholder}
{...(path && inputProps(path))}
/>
<p>{error}</p>
{touched && <p>{error}</p>}
</label>
</div>
);