Skip to content

Commit

Permalink
Add UI button for sub scraping
Browse files Browse the repository at this point in the history
  • Loading branch information
sussy-code committed May 10, 2024
1 parent 69c6d74 commit d483711
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
window.__CONFIG__ = {
// The URL for the CORS proxy, the URL must NOT end with a slash!
// If not specified, the onboarding will not allow a "default setup". The user will have to use the extension or set up a proxy themselves
VITE_CORS_PROXY_URL: "https://sudo-proxy.up.railway.app",
VITE_CORS_PROXY_URL: "https://glittering-bienenstitch-80b8e6.netlify.app",

// The READ API key to access TMDB
VITE_TMDB_READ_API_KEY: "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI1NzlkZWYyZDY5ZWFlNDk4ZjJiOTI4MTgyNDdjM2ViMCIsInN1YiI6IjY2MjdmMGJlNjJmMzM1MDE0YmQ4NTFmMiIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.h3KpPvkiaz8uNz1bntAKqsPrxG_4UUWaY3kYME6N6m8",
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import classNames from "classnames";
import { memo, useEffect, useRef } from "react";

export enum Icons {
WEB = "web",
SEARCH = "search",
BOOKMARK = "bookmark",
BOOKMARK_OUTLINE = "bookmark_outline",
Expand Down Expand Up @@ -73,6 +74,7 @@ export interface IconProps {
}

const iconList: Record<Icons, string> = {
web: `<svg xmlns="http://www.w3.org/2000/svg" width="1.2em" height="1.2em" viewBox="0 0 24 24" fill="none"><path fill="currentColor" d="M4 15L20 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path fill="currentColor" d="M4 9L20 9" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="12" cy="12" r="9" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path fill="currentColor" d="M12.0004 20.8182L11.2862 21.5181C11.4742 21.7101 11.7317 21.8182 12.0004 21.8182C12.2691 21.8182 12.5265 21.7101 12.7146 21.5181L12.0004 20.8182ZM12.0004 3.18188L12.7146 2.48198C12.5265 2.29005 12.2691 2.18188 12.0004 2.18188C11.7317 2.18188 11.4742 2.29005 11.2861 2.48198L12.0004 3.18188ZM14.6004 12.0001C14.6004 15.1611 13.3373 18.0251 11.2862 20.1183L12.7146 21.5181C15.1173 19.0662 16.6004 15.7053 16.6004 12.0001H14.6004ZM11.2861 3.88178C13.3373 5.97501 14.6004 8.83903 14.6004 12.0001H16.6004C16.6004 8.29478 15.1173 4.93389 12.7146 2.48198L11.2861 3.88178ZM9.40039 12.0001C9.40039 8.83903 10.6634 5.97501 12.7146 3.88178L11.2861 2.48198C8.88347 4.93389 7.40039 8.29478 7.40039 12.0001H9.40039ZM12.7146 20.1183C10.6634 18.0251 9.40039 15.1611 9.40039 12.0001H7.40039C7.40039 15.7053 8.88348 19.0662 11.2862 21.5181L12.7146 20.1183Z" fill="currentColor"/></svg>`,
search: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="currentColor" d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"/></svg>`,
bookmark: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="currentColor" d="M384 48V512l-192-112L0 512V48C0 21.5 21.5 0 48 0h288C362.5 0 384 21.5 384 48z"/></svg>`,
clock: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="currentColor" d="M256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512zM232 256C232 264 236 271.5 242.7 275.1L338.7 339.1C349.7 347.3 364.6 344.3 371.1 333.3C379.3 322.3 376.3 307.4 365.3 300L280 243.2V120C280 106.7 269.3 96 255.1 96C242.7 96 231.1 106.7 231.1 120L232 256z"/></svg>`,
Expand Down
11 changes: 9 additions & 2 deletions src/components/player/atoms/settings/CaptionsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useAsyncFn } from "react-use";
import { convert } from "subsrt-ts";

import { subtitleTypeList } from "@/backend/helpers/subs";
import { IconPatch } from "@/components/buttons/IconPatch";

Check warning on line 9 in src/components/player/atoms/settings/CaptionsView.tsx

View workflow job for this annotation

GitHub Actions / Build PWA

'IconPatch' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 9 in src/components/player/atoms/settings/CaptionsView.tsx

View workflow job for this annotation

GitHub Actions / Build

'IconPatch' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 9 in src/components/player/atoms/settings/CaptionsView.tsx

View workflow job for this annotation

GitHub Actions / Run Linters

'IconPatch' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 9 in src/components/player/atoms/settings/CaptionsView.tsx

View workflow job for this annotation

GitHub Actions / Build project

'IconPatch' is defined but never used. Allowed unused vars must match /^_/u
import { FileDropHandler } from "@/components/DropFile";
import { FlagIcon } from "@/components/FlagIcon";
import { Icon, Icons } from "@/components/Icon";
Expand Down Expand Up @@ -215,7 +216,7 @@ export function CaptionsView({ id }: { id: string }) {
<button
type="button"
onClick={() => router.navigate("/captions/settings")}
className="-mr-2 -my-1 px-2 p-[0.4em] rounded tabbable hover:bg-video-context-light hover:bg-opacity-10"
className="-mr-2 -my-1 px-2 p-[0.4em] rounded tabbable duration-200 hover:bg-video-context-light hover:bg-opacity-10"
>
{t("player.menus.subtitles.customizeLabel")}
</button>
Expand All @@ -231,8 +232,14 @@ export function CaptionsView({ id }: { id: string }) {
}}
onDrop={(event) => onDrop(event)}
>
<div className="mt-3">
<div className="flex flex-row gap-2 mt-3">
<Input value={searchQuery} onInput={setSearchQuery} />
<button
type="button"
className="p-2 rounded tabbable duration-200 hover:bg-video-context-light hover:bg-opacity-10"
>
<Icon icon={Icons.WEB} />
</button>
</div>
<Menu.ScrollToActiveSection className="!pt-1 mt-2 pb-3">
<CaptionOption
Expand Down

0 comments on commit d483711

Please sign in to comment.