repo_id
stringclasses
563 values
file_path
stringlengths
40
166
content
stringlengths
1
2.94M
__index_level_0__
int64
0
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Tooltip/index.ts
export { default } from "./Tooltip"; export type { TooltipProps } from "./Tooltip";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Tutorial/TutorialDetails.tsx
import { FC } from "react"; import styled, { css } from "styled-components"; import Link from "../Link"; import Tag from "../Tag"; import { Arrayable, TutorialDetailKey } from "../../utils/pg"; import { useDifferentBackground } from "../../hooks"; interface TutorialDetailsProps { details: ClickableTutorialDetailPro...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Tutorial/Tutorial.tsx
import { FC, useEffect } from "react"; import styled, { css } from "styled-components"; import { About, Main } from "./views"; import { PgTheme, PgTutorial } from "../../utils/pg"; import { useRenderOnChange } from "../../hooks"; import type { TutorialComponentProps } from "./types"; export const Tutorial: FC<Tutoria...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Tutorial/types.ts
import type { TupleFiles } from "../../utils/pg"; export type TutorialComponentProps = { /** About section that will be shown under the description of the tutorial page */ about: TutorialElement; /* Tutorial pages to show next to the editor */ pages: Page[]; /** Initial files to have at the beginning of the ...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Tutorial/index.ts
export * from "./Tutorial"; export * from "./types";
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Tutorial
solana_public_repos/solana-playground/solana-playground/client/src/components/Tutorial/views/Main.tsx
import { FC, useEffect, useRef } from "react"; import styled, { css } from "styled-components"; import Split from "react-split"; import Button from "../../Button"; import Markdown from "../../Markdown"; // TODO: Fix importing views from components import { EditorWithTabs } from "../../../views/main/primary/EditorWithT...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Tutorial
solana_public_repos/solana-playground/solana-playground/client/src/components/Tutorial/views/index.ts
export { About } from "./About"; export { Main } from "./Main";
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Tutorial
solana_public_repos/solana-playground/solana-playground/client/src/components/Tutorial/views/About.tsx
import { FC, Fragment } from "react"; import styled, { css } from "styled-components"; import Button from "../../Button"; import Link from "../../Link"; import Markdown from "../../Markdown"; import TutorialDetails from "../TutorialDetails"; import { PointedArrow, Triangle } from "../../Icons"; import { PgTheme, PgTut...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Loading/App.tsx
import styled from "styled-components"; import { ThreeDots } from "./ThreeDots"; export const AppLoading = () => ( <Wrapper> <ThreeDots /> </Wrapper> ); const Wrapper = styled.div` position: relative; height: 100vh; width: 100vw; & > :first-child { position: absolute; bottom: 1rem; left:...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Loading/ThreeDots.tsx
import styled, { css, keyframes } from "styled-components"; interface ThreeDotsProps { width?: string; height?: string; distance?: string; } export const ThreeDots = styled.div<ThreeDotsProps>` ${({ theme, width = "0.5rem", height = "0.5rem", distance = "1rem" }) => css` --bg: ${theme.colors.default.prima...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Loading/index.ts
export { Wormhole } from "./Wormhole"; export { Spinner, SpinnerWithBg, spinnerAnimation } from "./Spinner"; export { Skeleton } from "./Skeleton";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Loading/Wormhole.tsx
import { FC } from "react"; import styled, { css, keyframes } from "styled-components"; // in rem const DEFAULT_SIZE = 3; const DEFAULT_CIRCLE_COUNT = 8; interface WormholeProps { size?: number; circleCount?: number; } export const Wormhole: FC<WormholeProps> = ({ size = DEFAULT_SIZE, circleCount = DEFAULT_C...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Loading/Spinner.tsx
import { FC } from "react"; import styled, { css, keyframes } from "styled-components"; import { ClassName } from "../../constants"; import { PgTheme } from "../../utils/pg"; interface SpinnerWithBgProps extends SpinnerProps { loading: boolean; className?: string; } export const SpinnerWithBg: FC<SpinnerWithBgPr...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Loading/Skeleton.tsx
import styled, { css, keyframes } from "styled-components"; import { PgTheme } from "../../utils/pg"; interface SkeletonProps { height?: string; width?: string; } export const Skeleton = styled.div<SkeletonProps>` ${({ theme, height = "1rem", width = "100%" }) => { const skeleton = theme.components.skeleto...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/ErrorBoundary/index.ts
export { default } from "./ErrorBoundary";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/ErrorBoundary/Fallback.tsx
import { FC } from "react"; import Text from "../Text"; import { Sad } from "../Icons"; interface FallbackProps { /** Error that was thrown */ error: Error; } const Fallback: FC<FallbackProps> = ({ error }) => ( <Text kind="error" icon={<Sad />}> <div>There was an unexpected error!</div> {error.message...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/ErrorBoundary/ErrorBoundary.tsx
import { Component, ErrorInfo, ReactNode } from "react"; import styled, { css } from "styled-components"; import Button from "../Button"; import Tooltip from "../Tooltip"; import Fallback from "./Fallback"; import { Refresh } from "../Icons"; interface Props { /** Node to render as children */ children?: ReactNod...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Foldable/index.ts
export { default } from "./Foldable";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Foldable/Foldable.tsx
import { FC, ReactNode, useCallback, useEffect, useRef, useState, Dispatch, SetStateAction, } from "react"; import styled from "styled-components"; import { ClassName } from "../../constants"; import { ShortArrow } from "../Icons"; interface FoldableProps { element: ReactNode; isOpen?: boolean; ...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/CodeBlock/highlight.ts
import { getHighlighter, Highlighter, Lang, renderToHtml, setCDN, setWasm, Theme, toShikiTheme, } from "shiki"; import type { IRawTheme } from "vscode-textmate"; import { OrString, PgCommon } from "../../utils/pg"; /** * Convert the given code to HTML. * * @param code code to highlight * @param la...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/CodeBlock/index.ts
export { default } from "./CodeBlock"; export type { CodeBlockProps } from "./CodeBlock";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/CodeBlock/CodeBlock.tsx
import { useState } from "react"; import styled, { css, useTheme } from "styled-components"; import CopyButton from "../CopyButton"; import { highlight } from "./highlight"; import { PgTheme } from "../../utils/pg"; import { useAsyncEffect, useDifferentBackground } from "../../hooks"; export interface CodeBlockProps ...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/ImportButton/ImportButton.tsx
import { ChangeEvent, FC, useRef, useState } from "react"; import styled, { css } from "styled-components"; import Button, { ButtonKind } from "../Button"; interface ImportButtonProps { onImport: (ev: ChangeEvent<HTMLInputElement>) => Promise<void>; accept?: string; showImportText?: boolean; buttonKind?: Butt...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/ImportButton/index.ts
export { default } from "./ImportButton";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Input/index.ts
export { default } from "./Input"; export type { InputProps } from "./Input";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Input/Input.tsx
import { ComponentPropsWithoutRef, Dispatch, FocusEvent, forwardRef, SetStateAction, } from "react"; import styled, { css } from "styled-components"; import { ClassName } from "../../constants"; import { PgTheme } from "../../utils/pg"; type InputError = string | boolean | null; export interface InputProps...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Markdown/Markdown.tsx
import ReactMarkdown from "react-markdown"; import styled, { css } from "styled-components"; import remarkGfm from "remark-gfm"; import CodeBlock from "../CodeBlock"; import Link, { LinkProps } from "../Link"; import { PgTheme } from "../../utils/pg"; interface MarkdownProps { /** Markdown string */ children: str...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Markdown/index.ts
export { default } from "./Markdown";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd/Dnd.tsx
import Context from "./Context"; import Draggable from "./Draggable"; import Droppable from "./Droppable"; import Sortable from "./Sortable"; const Dnd = { Context, Draggable, Droppable, Sortable, }; export default Dnd;
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd/index.ts
export { default } from "./Dnd"; export type { DragStartEvent, DragEndEvent } from "@dnd-kit/core";
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd/Context/Context.tsx
import { FC } from "react"; import ReactDOM from "react-dom"; import { DndContext, MouseSensor, useSensor, useSensors, DndContextProps, DragOverlayProps, DragOverlay, } from "@dnd-kit/core"; interface ContextProps extends DndContextProps { dragOverlay?: DragOverlayProps & { Element: JSX.Element | n...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd/Context/index.ts
export { default } from "./Context";
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd/Droppable/Droppable.tsx
import { CSSProperties, FC, useEffect } from "react"; import { UniqueIdentifier, useDroppable } from "@dnd-kit/core"; interface DroppableProps { id: UniqueIdentifier; overStyle?: CSSProperties; onDragOver?: (ref: HTMLElement) => void; } const Droppable: FC<DroppableProps> = ({ id, overStyle, onDragOver, ...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd/Droppable/index.ts
export { default } from "./Droppable";
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd/Draggable/Draggable.tsx
import { ForwardRefExoticComponent } from "react"; import { UniqueIdentifier, useDraggable, UseDraggableArguments, } from "@dnd-kit/core"; interface DraggableProps<P> { Item: ForwardRefExoticComponent<P>; itemProps: P; id: UniqueIdentifier; } const Draggable = <P,>({ Item, itemProps, id }: DraggableProps<...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd/Draggable/index.ts
export { default } from "./Draggable";
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd/Sortable/index.ts
export { default } from "./Sortable"; export type { SortableItemProvidedProps } from "./Sortable";
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd
solana_public_repos/solana-playground/solana-playground/client/src/components/Dnd/Sortable/Sortable.tsx
import { Dispatch, ForwardRefExoticComponent, SetStateAction, useState, } from "react"; import { DragEndEvent, DragStartEvent, UniqueIdentifier } from "@dnd-kit/core"; import { arrayMove, horizontalListSortingStrategy, rectSortingStrategy, rectSwappingStrategy, SortableContext, useSortable, vertic...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Toast/index.ts
export { default } from "./Toast"; export type { ToastChildProps } from "./Toast";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Toast/Toast.tsx
import { useCallback } from "react"; import styled, { css } from "styled-components"; import { ToastContainer, toast } from "react-toastify"; import "react-toastify/dist/ReactToastify.min.css"; import { EventName } from "../../constants"; import { PgCommon, PgTheme } from "../../utils/pg"; import { useSetStatic } from...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Checkbox/index.ts
export { default } from "./Checkbox";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Checkbox/Checkbox.tsx
import { ComponentPropsWithoutRef, FC, forwardRef, ReactNode } from "react"; import styled, { css } from "styled-components"; interface CheckBoxProps extends ComponentPropsWithoutRef<"input"> { /** Checkbox `label` to show */ label?: ReactNode; } const Checkbox: FC<CheckBoxProps> = forwardRef<HTMLInputElement, Ch...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Terminal/Terminal.tsx
import { FC, useEffect, useMemo, useRef } from "react"; import styled, { css, useTheme } from "styled-components"; import "xterm/css/xterm.css"; import { EventName } from "../../constants"; import { useExposeStatic, useKeybind } from "../../hooks"; import { CommandManager, PgCommon, PgTerm, PgTerminal, PgThe...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Terminal/index.ts
export { default } from "./Terminal";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/ProgressBar/ProgressBar.tsx
import { FC, useEffect, useRef } from "react"; import styled, { css, useTheme } from "styled-components"; import { PgTheme } from "../../utils/pg"; interface ProgressBarProps { value: number; } const ProgressBar: FC<ProgressBarProps> = ({ value }) => { const wrapperRef = useRef<HTMLDivElement>(null); const th...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/ProgressBar/index.ts
export { default } from "./ProgressBar";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/ModalBackdrop/ModalBackdrop.tsx
import { ReactElement, useCallback, useState } from "react"; import styled, { css } from "styled-components"; import { EventName } from "../../constants"; import { PgCommon, PgTheme, PgView } from "../../utils/pg"; import { useKeybind, useSetStatic } from "../../hooks"; const ModalBackdrop = () => { const [modal, s...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/ModalBackdrop/index.ts
export { default } from "./ModalBackdrop";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/FadeIn/index.ts
export { default } from "./FadeIn";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/FadeIn/FadeIn.tsx
import styled, { css, keyframes } from "styled-components"; interface FadeInProps {} const FadeIn = styled.div<FadeInProps>` ${({ theme }) => css` animation: ${fadeIn} ${theme.default.transition.duration.short} ${theme.default.transition.type} forwards; `} `; const fadeIn = keyframes` 0% { opacity: 0...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/ExportButton/ExportButton.tsx
import { FC } from "react"; import styled from "styled-components"; import Button, { ButtonKind } from "../Button"; import { PgCommon } from "../../utils/pg"; interface ExportButtonProps { href: string | object; fileName: string; buttonKind?: ButtonKind; noButton?: boolean; } const ExportButton: FC<ExportBut...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/ExportButton/index.ts
export { default } from "./ExportButton";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Img/Img.tsx
import { ComponentPropsWithoutRef, forwardRef } from "react"; interface ImgProps extends ComponentPropsWithoutRef<"img"> { /** Whether to block cross origin source */ noCrossOrigin?: boolean; } const Img = forwardRef<HTMLImageElement, ImgProps>( ({ noCrossOrigin, ...props }, ref) => ( <img ref={ref} ...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Img/index.ts
export { default } from "./Img";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Popover/Popover.tsx
import { FC, ReactNode, useCallback, useEffect, useLayoutEffect, useRef, useState, } from "react"; import ReactDOM from "react-dom"; import styled, { css } from "styled-components"; import FadeIn from "../FadeIn"; import { Id } from "../../constants"; import { PgCommon, RequiredKey, ValueOf } from "../.....
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Popover/index.ts
export { default } from "./Popover"; export type { PopoverProps } from "./Popover";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/LangIcon/LangIcon.tsx
import { FC, useMemo } from "react"; import styled from "styled-components"; import { PgLanguage } from "../../utils/pg"; import { JavaScript, Json, Python, QuestionMark, Rust, TypeScript, } from "../Icons"; interface LangIconProps { /** File path to decide the language from */ path: string; } const ...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/LangIcon/index.ts
export { default } from "./LangIcon";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Button/index.ts
export { default } from "./Button"; export * from "./Button";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Button/Button.tsx
import { ComponentPropsWithoutRef, forwardRef, MouseEvent, ReactNode, useEffect, useState, } from "react"; import styled, { css, CSSProperties, DefaultTheme } from "styled-components"; import { spinnerAnimation } from "../Loading"; import { ClassName } from "../../constants"; import { PgTheme } from "../.....
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Link/Link.tsx
import { ComponentPropsWithoutRef, forwardRef } from "react"; import { Link as RouterLink } from "react-router-dom"; import styled, { css, DefaultTheme } from "styled-components"; import { External } from "../Icons"; import type { OrString } from "../../utils/pg"; export interface LinkProps extends ComponentPropsWith...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Link/index.ts
export { default } from "./Link"; export type { LinkProps } from "./Link";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Delayed/index.ts
export { default } from "./Delayed";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Delayed/Delayed.tsx
import { FC, useEffect, useState } from "react"; interface DelayedProps { /** The amount of miliseconds to sleep before rendering the `children` */ delay?: number; } const Delayed: FC<DelayedProps> = ({ delay, children }) => { const [ready, setReady] = useState(false); useEffect(() => { const id = setTim...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Icons/Icons.tsx
import styled, { css } from "styled-components"; import type { FC } from "react"; import type { SvgProperties } from "csstype"; import { PgTheme, ThemeColor } from "../../utils/pg"; interface IconProps { color?: ThemeColor; rotate?: "90deg" | "180deg" | "270deg"; } interface IconPropsInternal extends SvgProperti...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Icons/index.ts
export * from "./Icons";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/FilterGroups/FilterGroups.tsx
import { ComponentProps, FC } from "react"; import { useSearchParams } from "react-router-dom"; import styled, { css } from "styled-components"; import Checkbox from "../Checkbox"; import Tag from "../Tag"; import type { Arrayable } from "../../utils/pg"; interface FilterGroupsProps<P extends string> { filters: rea...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/FilterGroups/index.ts
export { default } from "./FilterGroups";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Menu/MenuWrapper.tsx
import { ComponentPropsWithoutRef, forwardRef } from "react"; import styled, { css, DefaultTheme } from "styled-components"; import FadeIn from "../FadeIn"; import { Fn, PgTheme } from "../../utils/pg"; import { useKeybind } from "../../hooks"; import type { MenuKind } from "./Menu"; interface MenuWrapperProps extend...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Menu/index.tsx
export { default } from "./Menu"; export type { MenuKind } from "./Menu"; export type { MenuItemProps } from "./MenuItem";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Menu/MenuItem.tsx
import { FC, ReactNode } from "react"; import styled, { css } from "styled-components"; import { PgTheme, ThemeColor } from "../../utils/pg"; export interface MenuItemProps { name: string; onClick: () => void; keybind?: string; color?: ThemeColor; hoverColor?: ThemeColor; icon?: ReactNode; showCondition...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Menu/ContextMenu.tsx
import { FC, MouseEvent, useCallback, useEffect, useLayoutEffect, useRef, useState, } from "react"; import ReactDOM from "react-dom"; import styled, { css } from "styled-components"; import MenuItem from "./MenuItem"; import { MenuWrapper } from "./MenuWrapper"; import { Id } from "../../constants"; impo...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Menu/Menu.tsx
import ContextMenu from "./ContextMenu"; import DropdownMenu from "./DropdownMenu"; import type { MenuItemProps } from "./MenuItem"; import type { Fn } from "../../utils/pg"; export type MenuKind = "context" | "dropdown"; export type CommonMenuProps = { items: MenuItemProps[]; onShow?: Fn; onHide?: Fn; }; cons...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Menu/DropdownMenu.tsx
import { FC, useCallback, useEffect, useRef, useState } from "react"; import styled from "styled-components"; import MenuItem from "./MenuItem"; import { MenuWrapper } from "./MenuWrapper"; import { useOnClickOutside } from "../../hooks"; import type { CommonMenuProps } from "./Menu"; // Circular dependency export ty...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/Settings.tsx
import { FC } from "react"; import styled from "styled-components"; import Button from "../Button"; import Img from "../Img"; import Menu, { MenuItemProps } from "../Menu"; import { Airdrop, Copy, Edit, ExportFile, ImportFile, Plus, ThreeDots, Trash, } from "../Icons"; import { Fn, PgCommand, PgView, P...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/Wallet.tsx
import { FC, useCallback, useEffect, useRef, useState } from "react"; import styled, { css } from "styled-components"; import { Rnd } from "react-rnd"; import Balance from "./Balance"; import Send from "./Send"; import Settings from "./Settings"; import Transactions from "./Transactions"; import Button from "../Button...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/Transactions.tsx
import { FC, useCallback, useEffect, useState } from "react"; import styled, { css } from "styled-components"; import Button from "../Button"; import Link from "../Link"; import { Clock, Refresh, Sad, Error as ErrorIcon } from "../Icons"; import { SpinnerWithBg } from "../Loading"; import { PgCommon, PgTheme, PgWallet...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/Balance.tsx
import styled, { css } from "styled-components"; import { PgTheme } from "../../utils/pg"; import { useBalance } from "../../hooks"; const Balance = () => { const { balance } = useBalance(); if (balance === null) return null; return <Wrapper>{balance === 0 ? 0 : balance.toFixed(3)} SOL</Wrapper>; }; const Wr...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/index.ts
export { default } from "./Wallet";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/Send.tsx
import { useEffect, useState } from "react"; import styled, { css } from "styled-components"; import Button from "../Button"; import Input from "../Input"; import Foldable from "../Foldable"; import { PgCommon, PgTerminal, PgTheme, PgTx, PgWallet, PgWeb3, } from "../../utils/pg"; import { useBalance, useKe...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/Modals/Approve.tsx
import { FC } from "react"; import styled from "styled-components"; import Modal from "../../Modal"; interface ApproveProps {} // TODO: const Approve: FC<ApproveProps> = ({}) => { const handleApprove = () => {}; return ( <Modal title buttonProps={{ text: "Approve", onSubmit: handleApprove }}> <Content...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/Modals/Add.tsx
import { useState } from "react"; import styled, { css } from "styled-components"; import Button from "../../Button"; import Input from "../../Input"; import Modal from "../../Modal"; import Text from "../../Text"; import { Info } from "../../Icons"; import { PgWallet, PgWeb3 } from "../../../utils/pg"; export const ...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/Modals/Remove.tsx
import styled, { css } from "styled-components"; import Button from "../../Button"; import Modal from "../../Modal"; import Text from "../../Text"; import { Warning } from "../../Icons"; import { PgWallet } from "../../../utils/pg"; export const Remove = () => { const handleRemove = () => PgWallet.remove(); const...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/Modals/Setup.tsx
import { useState } from "react"; import styled, { css } from "styled-components"; import Button from "../../Button"; import Modal from "../../Modal"; import Text from "../../Text"; import { Warning } from "../../Icons"; import { PgWallet, PgWeb3 } from "../../../utils/pg"; export const Setup = () => { const [text,...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/hooks/useStandardAccountChange.tsx
import { useEffect } from "react"; import { useWallet } from "../../../hooks"; import { PgWallet } from "../../../utils/pg"; /** * Update the standard wallet when the user switches between accounts. * * This only applies to Standard Wallets. */ export const useStandardAccountChange = () => { const { wallet } = ...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/hooks/useSyncBalance.tsx
import { useEffect } from "react"; import { useConnection, useWallet } from "../../../hooks"; import { PgCommon, PgConnection, PgWallet } from "../../../utils/pg"; /** Sync the balance of the current wallet. */ export const useSyncBalance = () => { const { connection, isConnected } = useConnection(); const { wall...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/hooks/useDarken.tsx
import { useCallback } from "react"; import { ClassName, Id } from "../../../constants"; /** Darken/lighten the wallet component. */ export const useDarken = () => { const darken = useCallback(() => { document.getElementById(Id.WALLET_MAIN)?.classList.add(ClassName.DARKEN); }, []); const lighten = useCallb...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/hooks/useAirdrop.tsx
import { useEffect, useState } from "react"; import { Emoji } from "../../../constants"; import { PgCommon, PgConnection, PgTerminal, PgTx, PgWallet, } from "../../../utils/pg"; export const useAirdrop = () => { const [airdropAmount, setAirdropAmount] = useState<ReturnType<typeof PgCommon["getAirdropA...
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/hooks/index.ts
export { useAirdrop } from "./useAirdrop"; export { useAutoAirdrop } from "./useAutoAirdrop"; export { useDarken } from "./useDarken"; export { useStandardAccountChange } from "./useStandardAccountChange"; export { useSyncBalance } from "./useSyncBalance";
0
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet
solana_public_repos/solana-playground/solana-playground/client/src/components/Wallet/hooks/useAutoAirdrop.tsx
import { useEffect, useRef } from "react"; import { PgCommon, PgConnection, PgSettings, PgTx } from "../../../utils/pg"; import { useBalance, useConnection, useRenderOnChange, useWallet, } from "../../../hooks"; /** Request airdrop when necessary. */ export const useAutoAirdrop = () => { const automaticAird...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Resizable/Resizable.tsx
import { forwardRef } from "react"; import styled, { css } from "styled-components"; import { Resizable as ReResizable, ResizableProps as ReResizableProps, Enable, } from "re-resizable"; type ResizableProps = Omit<ReResizableProps, "enable"> & { enable?: Enable | "top" | "right" | "bottom" | "left"; }; const ...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Resizable/index.ts
export { default } from "./Resizable";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Text/index.ts
export { default } from "./Text"; export type { TextKind } from "./Text";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Text/Text.tsx
import { ComponentPropsWithoutRef, forwardRef, ReactNode } from "react"; import styled, { css } from "styled-components"; import { useDifferentBackground } from "../../hooks"; import { PgTheme } from "../../utils/pg"; export type TextKind = "default" | "info" | "warning" | "success" | "error"; interface TextProps ex...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Select/index.ts
export { default } from "./Select";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Select/Select.tsx
import ReactSelect, { GroupBase, Props } from "react-select"; import styled, { css, useTheme } from "styled-components"; import { PgTheme } from "../../utils/pg"; const Select = < Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option> >( props: Props<Option, IsMulti, Grou...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/FilePicker/FilePicker.tsx
import { ChangeEvent, Dispatch, FC, SetStateAction, useCallback, useEffect, useMemo, useRef, } from "react"; import styled, { css } from "styled-components"; import Checkbox from "../Checkbox"; import LangIcon from "../LangIcon"; import { PgCommon, PgExplorer } from "../../utils/pg"; import { useDiffer...
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/FilePicker/index.ts
export { default } from "./FilePicker";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Modal/index.ts
export { default } from "./Modal";
0
solana_public_repos/solana-playground/solana-playground/client/src/components
solana_public_repos/solana-playground/solana-playground/client/src/components/Modal/Modal.tsx
import { Dispatch, FC, SetStateAction, useCallback, useRef, useState, } from "react"; import styled, { css } from "styled-components"; import Button, { ButtonProps } from "../Button"; import FadeIn from "../FadeIn"; import Text from "../Text"; import { Close, Sad } from "../Icons"; import { PROJECT_NAME } ...
0