my comment
', 8 | author, 9 | createdAt: new Date(2017, 1, 10, 0, 0).toISOString(), 10 | permalink: 'https://daily.dev', 11 | numUpvotes: 0, 12 | }; 13 | 14 | export default comment; 15 | -------------------------------------------------------------------------------- /packages/shared/__tests__/helpers/tanstack-query.tsx: -------------------------------------------------------------------------------- 1 | import type { QueryClientConfig } from '@tanstack/react-query'; 2 | 3 | export const defaultQueryClientTestingConfig: QueryClientConfig = { 4 | defaultOptions: { 5 | queries: { 6 | retry: false, 7 | }, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /packages/shared/custom.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.css'; 2 | 3 | type SvgrComponent = React.FCNo blocked members found
11 |{label}
17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /packages/shared/src/components/streak/popup/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ReadingStreakPopup'; 2 | export * from './StreakSection'; 3 | export * from './DayStreak'; 4 | -------------------------------------------------------------------------------- /packages/shared/src/components/tabs/common.tsx: -------------------------------------------------------------------------------- 1 | import type { ReactNode } from 'react'; 2 | 3 | export type RenderTab = ({ 4 | label, 5 | isActive, 6 | }: { 7 | label: string; 8 | isActive: boolean; 9 | }) => ReactNode | null; 10 | -------------------------------------------------------------------------------- /packages/shared/src/components/tags/common.tsx: -------------------------------------------------------------------------------- 1 | import type { Tag } from '../../graphql/feedSettings'; 2 | 3 | export type OnSelectTagProps = { 4 | tag: Tag; 5 | action: 'follow' | 'unfollow'; 6 | }; 7 | -------------------------------------------------------------------------------- /packages/shared/src/components/text/Anchor.tsx: -------------------------------------------------------------------------------- 1 | import type { ReactElement } from 'react'; 2 | import React from 'react'; 3 | import classNames from 'classnames'; 4 | 5 | export function Anchor({ 6 | className, 7 | children, 8 | ...props 9 | }: JSX.IntrinsicElements['a']): ReactElement { 10 | return ( 11 | 18 | {children} 19 | 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /packages/shared/src/components/text/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Anchor'; 2 | -------------------------------------------------------------------------------- /packages/shared/src/components/tooltips/index.ts: -------------------------------------------------------------------------------- 1 | export * from './SimpleTooltip'; 2 | -------------------------------------------------------------------------------- /packages/shared/src/components/tooltips/notifications/index.ts: -------------------------------------------------------------------------------- 1 | export * from './NotificationPreferenceMenu'; 2 | -------------------------------------------------------------------------------- /packages/shared/src/components/tooltips/utils.ts: -------------------------------------------------------------------------------- 1 | import classed from '../../lib/classed'; 2 | 3 | export const Bubble = classed( 4 | 'span', 5 | 'absolute flex justify-center items-center min-w-[1.25rem] min-h-[1.25rem] font-normal text-white rounded-8 bg-accent-cabbage-default typo-subhead', 6 | ); 7 | 8 | export const Badge = classed( 9 | 'span', 10 | 'flex flex-row justify-center items-center p-1 px-2 mr-2 rounded-full bg-accent-cabbage-default typo-caption1', 11 | ); 12 | -------------------------------------------------------------------------------- /packages/shared/src/components/utilities/index.ts: -------------------------------------------------------------------------------- 1 | export * from './common'; 2 | export * from './Divider'; 3 | export * from './SelectableLink'; 4 | export * from './DateFormat'; 5 | -------------------------------------------------------------------------------- /packages/shared/src/components/utilities/loaders/common.ts: -------------------------------------------------------------------------------- 1 | import classed from '../../../lib/classed'; 2 | import { ElementPlaceholder } from '../../ElementPlaceholder'; 3 | 4 | export const Pill = classed(ElementPlaceholder, 'h-8 rounded-12'); 5 | -------------------------------------------------------------------------------- /packages/shared/src/components/utilities/loaders/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './common'; 2 | export * from './generic'; 3 | -------------------------------------------------------------------------------- /packages/shared/src/components/utilities/utilities.module.css: -------------------------------------------------------------------------------- 1 | .pageContainer { 2 | max-width: $pageMaxWidth; 3 | margin: auto; 4 | 5 | @screen laptop { 6 | width: $pageMaxWidth; 7 | margin-left: calc(50% - (($pageMaxWidth / 2) - 3rem)); 8 | } 9 | 10 | @screen laptopL { 11 | width: $pageMaxWidth; 12 | margin: auto; 13 | } 14 | 15 | &:global(.modal-post) { 16 | margin: unset; 17 | } 18 | } 19 | 20 | .feedPage { 21 | &.notReady { 22 | & > * { 23 | visibility: hidden; 24 | } 25 | } 26 | } 27 | 28 | .activeTabIndicator { 29 | border-radius: 0.063rem; 30 | } 31 | -------------------------------------------------------------------------------- /packages/shared/src/components/video/common.ts: -------------------------------------------------------------------------------- 1 | import classed from '../../lib/classed'; 2 | 3 | export const YoutubeVideoContainer = classed( 4 | 'div', 5 | 'relative w-full overflow-hidden rounded-16 pt-[56.25%]', 6 | ); 7 | 8 | export const YoutubeVideoBackground = classed( 9 | 'div', 10 | 'absolute inset-0 z-1 flex flex-col bg-surface-float p-6', 11 | ); 12 | -------------------------------------------------------------------------------- /packages/shared/src/components/widgets/PostToc.module.css: -------------------------------------------------------------------------------- 1 | .details { 2 | &[open] { 3 | padding-bottom: 0.75rem; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/shared/src/components/widgets/common.ts: -------------------------------------------------------------------------------- 1 | import classed from '../../lib/classed'; 2 | import { ElementPlaceholder } from '../ElementPlaceholder'; 3 | 4 | export const widgetClasses = 5 | 'border border-border-subtlest-tertiary rounded-16'; 6 | 7 | export const WidgetContainer = classed('div', widgetClasses); 8 | 9 | export const TextPlaceholder = classed( 10 | ElementPlaceholder, 11 | 'h-3 rounded-12 my-0.5', 12 | ); 13 | 14 | export const PlaceholderSeparator = classed( 15 | 'div', 16 | 'h-px bg-border-subtlest-tertiary', 17 | ); 18 | -------------------------------------------------------------------------------- /packages/shared/src/contexts/WriteCommentContext.ts: -------------------------------------------------------------------------------- 1 | import { createContext, useContext } from 'react'; 2 | import type { UseMutateCommentResult } from '../hooks/post/useMutateComment'; 3 | 4 | interface WriteCommentContextProp { 5 | mutateComment: UseMutateCommentResult; 6 | } 7 | 8 | export const WriteCommentContext = createContext