diff --git a/custom/react/Countdown.tsx b/custom/react/Countdown.tsx new file mode 100644 index 0000000..89c881e --- /dev/null +++ b/custom/react/Countdown.tsx @@ -0,0 +1,3 @@ +import Countdown from "./components/Countdown"; + +export default Countdown; diff --git a/custom/react/Menu.tsx b/custom/react/Menu.tsx new file mode 100644 index 0000000..7772223 --- /dev/null +++ b/custom/react/Menu.tsx @@ -0,0 +1,11 @@ +import React from "react"; + +const Menu = () => { + return ( +
+

Menu

+
+ ); +}; + +export default Menu; diff --git a/custom/react/components/Countdown/assets/box.svg b/custom/react/components/Countdown/assets/box.svg new file mode 100644 index 0000000..9eb9c2f --- /dev/null +++ b/custom/react/components/Countdown/assets/box.svg @@ -0,0 +1,3 @@ + + + diff --git a/custom/react/components/Countdown/index.tsx b/custom/react/components/Countdown/index.tsx new file mode 100644 index 0000000..fd0a45b --- /dev/null +++ b/custom/react/components/Countdown/index.tsx @@ -0,0 +1,125 @@ +import React, { useState, useEffect } from "react"; +// import styles from "./styles.css"; +import clock from "./assets/box.svg"; +import { useCssHandles } from "vtex.css-handles"; + +interface CountdownProps { + //formato: dd/mm/yyyy/hh:mm + endDate: string; +} + +interface Time { + hour: number; + minute: number; + second: number; +} + +const Countdown = ({ endDate }: CountdownProps) => { + const [time, setTime] = useState