Skip to content

Instantly share code, notes, and snippets.

{
"compilerOptions": {
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"moduleResolution": "node",
"preserveWatchOutput": true,
"skipLibCheck": true,
"noEmit": true,
"strict": true
import styled from 'styled-components';
export const StyledPopup = styled.div`
display: block;
max-width: 400px;
max-height: 150px;
position: absolute;
top: 0;
right: 0;
bottom: 0;
{
"name": "Popup",
"main": "index.tsx",
"version": "1.0.0"
}
import { createPortal } from 'react-dom';
import { StyledBackdrop, StyledPopup } from './Popup.styled';
type TPopup = {
children?: React.ReactDOM;
showPopup: boolean;
setShowPopup: () => void;
}
export const Popup: React.FC<TPopup> = ({ children, showPopup, setShowPopup }) => {
{
"compilerOptions": {
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"moduleResolution": "node",
"preserveWatchOutput": true,
"skipLibCheck": true,
"noEmit": true,
"strict": true
{
"name": "Board",
"main": "index.tsx",
"version": "1.0.0"
}
export * from './Board';
import styled from 'styled-components';
export const KanbanBoard = styled.div`
max-width: 1460px;
margin: auto;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-gap: 1em;
`;
import { KanbanBoard } from './Board.styled';
type TBoard = {
children?: React.ReactDOM;
}
export const Board: React.FC<TBoard> = ({ children }) => {
return (
<KanbanBoard>
{children}
let arrayWithDuplicates = [1, 2, 1]
let arrayWithoutDuplicates = [1, 2, 3]
new Set(arrayWithDuplicates).size < arrayWithDuplicates.length // returns TRUE
new Set(arrayWithoutDuplicates).size < arrayWithoutDuplicates.length // returns FALSE