Skip to content

Commit

Permalink
Merge pull request #362 from AppQuality/player-colors
Browse files Browse the repository at this point in the history
Player-colors
  • Loading branch information
cannarocks authored May 21, 2024
2 parents 2fc0524 + f5ad49a commit d92f6c8
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Highlight } from "..";
import { formatDuration } from "../../player/parts/utils";
import { formatDuration } from "../../player/utils";
import { SM } from "../../typography/typescale";
import { StoryArgs } from "../index.stories";
import { DemoTranscript as demo } from "./data";
Expand Down
2 changes: 1 addition & 1 deletion src/stories/highlight/demo-parts/transcript-paragraph.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Highlight } from "..";
import { formatDuration } from "../../player/parts/utils";
import { formatDuration } from "../../player/utils";
import { SM } from "../../typography/typescale";
import { StoryArgs } from "../index.stories";
import { DemoTranscript as demo } from "./data";
Expand Down
2 changes: 1 addition & 1 deletion src/stories/highlight/demo-parts/transcript-sentiment.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { styled } from "styled-components";
import { Highlight } from "..";
import { formatDuration } from "../../player/parts/utils";
import { formatDuration } from "../../player/utils";
import { SM } from "../../typography/typescale";
import { StoryArgs } from "../index.stories";
import { DemoTranscript as demo, DemoSentiment } from "./data";
Expand Down
10 changes: 5 additions & 5 deletions src/stories/highlight/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const StyledWord = styled(ZendeskSpan)<

const ActiveWord = styled.span`
background-color: ${({ theme }) =>
getColor(theme.palette.fuschia, 700, undefined, 0.5)};
getColor(theme.palette.fuschia, 400, undefined, 0.4)};
padding: 0 2px;
`;

Expand Down Expand Up @@ -127,10 +127,10 @@ const Word = (props: WordProps) => {
>
{isActive ? (
<ActiveWord>
<Searchable start={props.start} text={props.text} />
<Searchable text={props.text} />
</ActiveWord>
) : (
<Searchable start={props.start} text={props.text} />
<Searchable text={props.text} />
)}{" "}
</StyledWord>
</Tooltip>
Expand All @@ -148,10 +148,10 @@ const Word = (props: WordProps) => {
>
{isActive ? (
<ActiveWord>
<Searchable start={props.start} text={props.text} />
<Searchable text={props.text} />
</ActiveWord>
) : (
<Searchable start={props.start} text={props.text} />
<Searchable text={props.text} />
)}{" "}
</StyledWord>
);
Expand Down
8 changes: 4 additions & 4 deletions src/stories/highlight/searchable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { useHighlightContext } from "./highlightContext";


const StyledSearchWord = styled.span`
background-color: ${({ theme }) => theme.palette.product.talk};
color: ${({ theme }) => theme.palette.grey[700]};`;
background-color: ${({ theme }) => theme.palette.product.talk};
color: ${({ theme }) => theme.palette.grey[700]};
`;

export const Searchable = ({
start,
text,
}: {
start: number;
text: string;
}) => {
const { searchTerm } = useHighlightContext();
Expand Down
14 changes: 14 additions & 0 deletions src/stories/player/_types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,23 @@ export interface IBookmark {
label?: string;
tooltipContent?: ReactNode;
onClick?: () => void;
tags: VideoTag[];
}

export interface WrapperProps {
isPlaying?: boolean;
isLoaded?: boolean;
}

type VideoTag = {
group: {
id: number;
name: string;
};
tag: {
id: number;
name: string;
style: string;
usageNumber: number;
};
};
2 changes: 1 addition & 1 deletion src/stories/player/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Container } from "./parts/container";
import { Controls } from "./parts/controls";
import { FloatingControls } from "./parts/floatingControls";
import { VideoSpinner } from "./parts/spinner";
import { ProgressContextProvider } from "./parts/progressContext";
import { ProgressContextProvider } from "./context/progressContext";

/**
* The Player is a styled media tag with custom controls
Expand Down
2 changes: 1 addition & 1 deletion src/stories/player/parts/bookmark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useVideoContext } from "@appquality/stream-player";
import { css, styled } from "styled-components";
import { Tooltip } from "../../tooltip";
import { IBookmark } from "../_types";
import { useProgressContext } from "./progressContext";
import { useProgressContext } from "../context/progressContext";
import { ReactComponent as GripIcon } from "../../../assets/icons/grip.svg";

const StyledGrabber = styled.div<{ isEnd?: boolean }>`
Expand Down
4 changes: 2 additions & 2 deletions src/stories/player/parts/controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { ControlsGroupCenter } from "./controlsCenterGroup";
import { Cutter } from "./cutterButton";
import { FullScreenButton } from "./fullScreenButton";
import { ProgressBar } from "./progress";
import { useProgressContext } from "./progressContext";
import { useProgressContext } from "../context/progressContext";
import { TimeLabel } from "./timeLabel";
import { PlayerTooltip } from "./tooltip";
import { formatDuration } from "./utils";
import { formatDuration } from "../utils";
import useDebounce from "../../../hooks/useDebounce";

export const ControlsWrapper = styled.div<WrapperProps>`
Expand Down
2 changes: 1 addition & 1 deletion src/stories/player/parts/controlsCenterGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ReactComponent as PlayIcon } from "../../../assets/icons/play-fill.svg"
import { ReactComponent as PreviousIcon } from "../../../assets/icons/previous-fill.svg";
import { SM } from "../../typography/typescale";
import { ControlButton } from "./controlButton";
import { getNextPlaybackRate } from "./utils";
import { getNextPlaybackRate } from "../utils";

const StyledDiv = styled.div`
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/stories/player/parts/progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface ProgressProps {
const StyledProgress = styled(Progress)`
width: 100%;
border-radius: 0;
color: ${({ theme }) => theme.palette.grey[700]};
color: ${({ theme }) => theme.palette.grey[400]};
cursor: pointer;
> div {
border-radius: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/stories/player/parts/timeLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from "styled-components";
import { SM } from "../../typography/typescale";
import { formatDuration } from "./utils";
import { formatDuration } from "../utils";

const StyledDiv = styled.div`
display: flex;
Expand Down
File renamed without changes.

0 comments on commit d92f6c8

Please sign in to comment.