Skip to content

Commit

Permalink
Load svgs inline with svgr
Browse files Browse the repository at this point in the history
  • Loading branch information
sipec committed Sep 6, 2023
1 parent 48d0076 commit e816063
Show file tree
Hide file tree
Showing 85 changed files with 1,797 additions and 606 deletions.
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"keywordCase": "lower",
"logicalOperatorNewline": "before"
}
},
{
"files": "*.svg",
"options": {
"parser": "html"
}
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"files.associations": {
"*.svg": "html"
},
"sqltools.connections": [
{
"previewLimit": 50,
Expand Down
4 changes: 2 additions & 2 deletions web/components/buttons/copy-link-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { Tooltip } from '../widgets/tooltip'
import clsx from 'clsx'
import { IconButton } from 'web/components/buttons/button'
import toast from 'react-hot-toast'
import LinkIcon from 'web/lib/icons/link-icon'
import LinkIcon from 'web/lib/icons/link-icon.svg'
import { postMessageToNative } from 'web/components/native-message-listener'
import { NativeShareData } from 'common/native-share-data'
import {
CheckIcon,
ClipboardCopyIcon,
DuplicateIcon,
} from '@heroicons/react/outline'
import ArrowUpSquareIcon from 'web/lib/icons/arrow-up-square-icon'
import ArrowUpSquareIcon from 'web/lib/icons/arrow-up-square-icon.svg'
import { getNativePlatform } from 'web/lib/native/is-native'
import { useBrowserOS } from 'web/hooks/use-browser-os'
import { ShareIcon } from '@heroicons/react/outline'
Expand Down
2 changes: 1 addition & 1 deletion web/components/buttons/tweet-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import clsx from 'clsx'
import { Contract } from 'common/contract'
import { formatMoneyNumber, formatPercent } from 'common/util/format'
import { getShareUrl } from 'common/util/share'
import TwitterLogo from 'web/lib/icons/twitter-logo'
import TwitterLogo from 'web/lib/icons/twitter-logo.svg'
import { trackCallback } from 'web/lib/service/analytics'
import { buttonClass } from './button'

Expand Down
2 changes: 1 addition & 1 deletion web/components/comments/reply-toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import clsx from 'clsx'
import TriangleDownFillIcon from 'web/lib/icons/triangle-down-fill-icon'
import TriangleDownFillIcon from 'web/lib/icons/triangle-down-fill-icon.svg'
import { Row } from '../layout/row'
import { formatMoney } from 'common/util/format'

Expand Down
2 changes: 1 addition & 1 deletion web/components/contract/contract-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { useHashInUrl } from 'web/hooks/use-hash-in-url'
import { useIsMobile } from 'web/hooks/use-is-mobile'
import { useLiquidity } from 'web/hooks/use-liquidity'
import { useUser } from 'web/hooks/use-user'
import TriangleDownFillIcon from 'web/lib/icons/triangle-down-fill-icon'
import TriangleDownFillIcon from 'web/lib/icons/triangle-down-fill-icon.svg'
import { track, withTracking } from 'web/lib/service/analytics'
import { getOlderBets } from 'web/lib/supabase/bets'
import { FreeResponseComments } from '../feed/feed-answer-comment-group'
Expand Down
6 changes: 3 additions & 3 deletions web/components/editor/floating-format-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { BubbleMenu } from '@tiptap/react'
import clsx from 'clsx'
import { getUrl } from 'common/util/parse'
import { useState } from 'react'
import BoldIcon from 'web/lib/icons/bold-icon'
import ItalicIcon from 'web/lib/icons/italic-icon'
import TypeIcon from 'web/lib/icons/type-icon'
import BoldIcon from 'web/lib/icons/bold-icon.svg'
import ItalicIcon from 'web/lib/icons/italic-icon.svg'
import TypeIcon from 'web/lib/icons/type-icon.svg'

// see https://tiptap.dev/guide/menus

Expand Down
2 changes: 1 addition & 1 deletion web/components/feed/feed-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getHistoryData } from 'web/pages/embed/[username]/[contractSlug]'
import { useViewScale } from '../charts/generic-charts'
import { BinaryChart } from '../contract/contract-overview'
import { DAY_MS } from 'common/util/time'
import PlaceholderGraph from 'web/lib/icons/placeholder-graph'
import PlaceholderGraph from 'web/lib/icons/placeholder-graph.svg'
import { usePersistentInMemoryState } from 'web/hooks/use-persistent-in-memory-state'

export function FeedBinaryChart(props: {
Expand Down
8 changes: 4 additions & 4 deletions web/components/feed/feed-comments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ import { useIsVisible } from 'web/hooks/use-is-visible'
import { isBlocked, usePrivateUser, useUser } from 'web/hooks/use-user'
import { createCommentOnContract, hideComment } from 'web/lib/firebase/api'
import { firebaseLogin, User } from 'web/lib/firebase/users'
import LinkIcon from 'web/lib/icons/link-icon'
import TriangleDownFillIcon from 'web/lib/icons/triangle-down-fill-icon'
import TriangleFillIcon from 'web/lib/icons/triangle-fill-icon'
import TriangleDownFillIcon from 'web/lib/icons/triangle-down-fill-icon.svg'
import TriangleFillIcon from 'web/lib/icons/triangle-fill-icon.svg'
import { track } from 'web/lib/service/analytics'
import { scrollIntoViewCentered } from 'web/lib/util/scroll'
import { Button, IconButton } from '../buttons/button'
Expand All @@ -51,6 +50,7 @@ import { InfoTooltip } from '../widgets/info-tooltip'
import { Tooltip } from '../widgets/tooltip'
import { isAdminId } from 'common/envs/constants'
import { PaymentsModal } from 'web/pages/payments'
import { FiLink } from 'react-icons/fi'
import { GiPayMoney } from 'react-icons/gi'

export type ReplyToUserInfo = { id: string; username: string }
Expand Down Expand Up @@ -378,7 +378,7 @@ export function DotMenu(props: {
Items={buildArray(
{
name: 'Copy link',
icon: <LinkIcon className="h-5 w-5" />,
icon: <FiLink className="h-5 w-5" />,
onClick: () => {
copyLinkToComment(
contract.creatorUsername,
Expand Down
8 changes: 4 additions & 4 deletions web/components/landing-page-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { Row } from './layout/row'
import { withTracking } from 'web/lib/service/analytics'
import { useTracking } from 'web/hooks/use-tracking'
import { useIsMobile } from 'web/hooks/use-is-mobile'
import SquiggleVerticalIcon from 'web/lib/icons/squiggle_vertical'
import SquiggleVerticalIcon from 'web/lib/icons/squiggle_vertical.svg'
import clsx from 'clsx'
import { Button } from './buttons/button'
import { useEffect, useState } from 'react'
import SquiggleHorizontalIcon from 'web/lib/icons/squiggle_horizontal'
import SquiggleHorizontalIcon from 'web/lib/icons/squiggle_horizontal.svg'
import TypewriterComponent from 'typewriter-effect'
import EquilateralLeftTriangle from 'web/lib/icons/equilateral-left-triangle'
import EquilateralRightTriangle from 'web/lib/icons/equilateral-right-triangle'
import EquilateralLeftTriangle from 'web/lib/icons/equilateral-left-triangle.svg'
import EquilateralRightTriangle from 'web/lib/icons/equilateral-right-triangle.svg'
import CountUp from 'react-countup'
import { ENV_CONFIG } from 'common/envs/constants'
import { STARTING_BALANCE } from 'common/economy'
Expand Down
4 changes: 2 additions & 2 deletions web/components/nav/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ import { NotificationsIcon } from 'web/components/notifications-icon'
import { DarkModeContext, useIsDarkMode } from 'web/hooks/dark-mode-context'
import { useUser } from 'web/hooks/use-user'
import { firebaseLogin, firebaseLogout } from 'web/lib/firebase/users'
import TrophyIcon from 'web/lib/icons/trophy-icon'
import TrophyIcon from 'web/lib/icons/trophy-icon.svg'
import { withTracking } from 'web/lib/service/analytics'
import { MobileAppsQRCodeDialog } from '../buttons/mobile-apps-qr-code-button'
import { SidebarSignUpButton } from '../buttons/sign-up-button'
import { ManifoldLogo } from './manifold-logo'
import { ProfileSummary } from './profile-summary'
import { SearchButton } from './search-button'
import { SidebarItem } from './sidebar-item'
import SquaresIcon from 'web/lib/icons/squares-icon'
import SquaresIcon from 'web/lib/icons/squares-icon.svg'

export default function Sidebar(props: {
className?: string
Expand Down
2 changes: 1 addition & 1 deletion web/components/notification-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { postMessageToNative } from 'web/components/native-message-listener'
import { UserWatchedContractsButton } from 'web/components/notifications/watched-markets'
import { usePrivateUser, useUser } from 'web/hooks/use-user'
import { usePersistentInMemoryState } from 'web/hooks/use-persistent-in-memory-state'
import TrophyIcon from 'web/lib/icons/trophy-icon'
import TrophyIcon from 'web/lib/icons/trophy-icon.svg'

const emailsEnabled: Array<notification_preference> = [
'all_comments_on_watched_markets',
Expand Down
2 changes: 1 addition & 1 deletion web/components/portfolio/portfolio-value-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { GraphMode, PortfolioGraph } from './portfolio-value-graph'
import { SizedContainer } from 'web/components/sized-container'
import { Period } from 'web/lib/firebase/users'
import { useEvent } from 'web/hooks/use-event'
import PlaceholderGraph from 'web/lib/icons/placeholder-graph'
import PlaceholderGraph from 'web/lib/icons/placeholder-graph.svg'
import { TimeRangePicker } from '../charts/time-range-picker'
import { ColorType } from '../widgets/choices-toggle-group'
import { useViewScale } from '../charts/generic-charts'
Expand Down
2 changes: 1 addition & 1 deletion web/components/swipe/swipe-sharer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import toast from 'react-hot-toast'

import { BinaryContract } from 'common/contract'
import { track } from 'web/lib/service/analytics'
import ArrowUpSquareIcon from '../../lib/icons/arrow-up-square-icon'
import ArrowUpSquareIcon from 'web/lib/icons/arrow-up-square-icon.svg'
import { getIsNative } from '../../lib/native/is-native'
import { postMessageToNative } from '../native-message-listener'
import { NativeShareData } from 'common/native-share-data'
Expand Down
8 changes: 4 additions & 4 deletions web/components/testimonials-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { Button } from 'web/components/buttons/button'
import { withTracking } from 'web/lib/service/analytics'
import { firebaseLogin } from 'web/lib/firebase/users'
import { STARTING_BALANCE } from 'common/economy'
import SquiggleVerticalFlippedIcon from 'web/lib/icons/squiggle_vertical_flipped'
import SquiggleHorizontalFlippedIcon from 'web/lib/icons/squiggle_horizontal_flipped'
import StartQuoteIcon from 'web/lib/icons/start_quote'
import EndQuoteIcon from 'web/lib/icons/start_quote copy'
import SquiggleVerticalFlippedIcon from 'web/lib/icons/squiggle_vertical_flipped.svg'
import SquiggleHorizontalFlippedIcon from 'web/lib/icons/squiggle_horizontal_flipped.svg'
import StartQuoteIcon from 'web/lib/icons/start_quote.svg'
import EndQuoteIcon from 'web/lib/icons/start_quote.svg'
import testimonials from '../public/testimonials/testimonials.json'

export function TestimonialsPanel() {
Expand Down
2 changes: 1 addition & 1 deletion web/components/widgets/user-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { BadgeCheckIcon } from '@heroicons/react/outline'
import { Row } from '../layout/row'
import { Avatar } from './avatar'
import { DAY_MS } from 'common/util/time'
import ScalesIcon from 'web/lib/icons/scales-icon'
import ScalesIcon from 'web/lib/icons/scales-icon.svg'
import { linkClass } from './site-link'

export const isFresh = (createdTime: number) =>
Expand Down
14 changes: 14 additions & 0 deletions web/lib/icons/arrow-up-square-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 0 additions & 21 deletions web/lib/icons/arrow-up-square-icon.tsx

This file was deleted.

15 changes: 15 additions & 0 deletions web/lib/icons/bold-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions web/lib/icons/bold-icon.tsx

This file was deleted.

10 changes: 10 additions & 0 deletions web/lib/icons/closed-door-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 0 additions & 15 deletions web/lib/icons/closed-door-icon.tsx

This file was deleted.

14 changes: 14 additions & 0 deletions web/lib/icons/corner-down-right-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 0 additions & 19 deletions web/lib/icons/corner-down-right-icon.tsx

This file was deleted.

20 changes: 20 additions & 0 deletions web/lib/icons/discord-outline-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 0 additions & 26 deletions web/lib/icons/discord-outline-icon.tsx

This file was deleted.

Loading

3 comments on commit e816063

@vercel
Copy link

@vercel vercel bot commented on e816063 Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-git-main-mantic.vercel.app
docs-mantic.vercel.app
docs-pi-teal.vercel.app
docs.manifold.markets

@vercel
Copy link

@vercel vercel bot commented on e816063 Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on e816063 Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dev – ./web

dev-manifold.vercel.app
dev-mantic.vercel.app
dev-git-main-mantic.vercel.app
dev.manifold.markets

Please sign in to comment.