mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
minor styling changes
This commit is contained in:
@@ -15,6 +15,8 @@ import TranscriptTitle from "../transcriptTitle";
|
|||||||
import Player from "../player";
|
import Player from "../player";
|
||||||
import WaveformLoading from "../waveformLoading";
|
import WaveformLoading from "../waveformLoading";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
import { faSpinner } from "@fortawesome/free-solid-svg-icons";
|
||||||
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
type TranscriptDetails = {
|
type TranscriptDetails = {
|
||||||
params: {
|
params: {
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import SelectSearch from "react-select-search";
|
|||||||
import "react-select-search/style.css";
|
import "react-select-search/style.css";
|
||||||
import "../../styles/button.css";
|
import "../../styles/button.css";
|
||||||
import "../../styles/form.scss";
|
import "../../styles/form.scss";
|
||||||
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
import { faSpinner } from "@fortawesome/free-solid-svg-icons";
|
||||||
|
|
||||||
type ShareLinkProps = {
|
type ShareLinkProps = {
|
||||||
transcriptId: string;
|
transcriptId: string;
|
||||||
@@ -20,6 +22,7 @@ const ShareLink = (props: ShareLinkProps) => {
|
|||||||
const requireLogin = featureEnabled("requireLogin");
|
const requireLogin = featureEnabled("requireLogin");
|
||||||
const [isOwner, setIsOwner] = useState(false);
|
const [isOwner, setIsOwner] = useState(false);
|
||||||
const [shareMode, setShareMode] = useState(props.shareMode);
|
const [shareMode, setShareMode] = useState(props.shareMode);
|
||||||
|
const [shareLoading, setShareLoading] = useState(false);
|
||||||
const userinfo = useFiefUserinfo();
|
const userinfo = useFiefUserinfo();
|
||||||
const api = getApi();
|
const api = getApi();
|
||||||
|
|
||||||
@@ -46,6 +49,7 @@ const ShareLink = (props: ShareLinkProps) => {
|
|||||||
|
|
||||||
const updateShareMode = async (selectedShareMode: string) => {
|
const updateShareMode = async (selectedShareMode: string) => {
|
||||||
if (!api) return;
|
if (!api) return;
|
||||||
|
setShareLoading(true);
|
||||||
const updatedTranscript = await api.v1TranscriptUpdate({
|
const updatedTranscript = await api.v1TranscriptUpdate({
|
||||||
transcriptId: props.transcriptId,
|
transcriptId: props.transcriptId,
|
||||||
updateTranscript: {
|
updateTranscript: {
|
||||||
@@ -53,6 +57,7 @@ const ShareLink = (props: ShareLinkProps) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
setShareMode(updatedTranscript.shareMode);
|
setShareMode(updatedTranscript.shareMode);
|
||||||
|
setShareLoading(false);
|
||||||
};
|
};
|
||||||
const privacyEnabled = featureEnabled("privacy");
|
const privacyEnabled = featureEnabled("privacy");
|
||||||
|
|
||||||
@@ -62,7 +67,7 @@ const ShareLink = (props: ShareLinkProps) => {
|
|||||||
style={{ background: "rgba(96, 165, 250, 0.2)" }}
|
style={{ background: "rgba(96, 165, 250, 0.2)" }}
|
||||||
>
|
>
|
||||||
{requireLogin && (
|
{requireLogin && (
|
||||||
<p className="text-sm mb-2">
|
<div className="text-sm mb-2">
|
||||||
{shareMode === "private" && (
|
{shareMode === "private" && (
|
||||||
<p>This transcript is private and can only be accessed by you.</p>
|
<p>This transcript is private and can only be accessed by you.</p>
|
||||||
)}
|
)}
|
||||||
@@ -76,7 +81,7 @@ const ShareLink = (props: ShareLinkProps) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{isOwner && api && (
|
{isOwner && api && (
|
||||||
<p>
|
<div className="relative">
|
||||||
<SelectSearch
|
<SelectSearch
|
||||||
className="select-search--top select-search"
|
className="select-search--top select-search"
|
||||||
options={[
|
options={[
|
||||||
@@ -86,10 +91,19 @@ const ShareLink = (props: ShareLinkProps) => {
|
|||||||
]}
|
]}
|
||||||
value={shareMode}
|
value={shareMode}
|
||||||
onChange={updateShareMode}
|
onChange={updateShareMode}
|
||||||
|
closeOnSelect={true}
|
||||||
/>
|
/>
|
||||||
</p>
|
{shareLoading && (
|
||||||
|
<div className="h-4 w-4 absolute top-1/3 right-3 z-10">
|
||||||
|
<FontAwesomeIcon
|
||||||
|
icon={faSpinner}
|
||||||
|
className="animate-spin-slow text-gray-600 flex-grow rounded-lg md:rounded-xl h-4 w-4"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</p>
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
{!requireLogin && (
|
{!requireLogin && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export default () => (
|
|||||||
<div className="flex flex-grow items-center justify-center h-20">
|
<div className="flex flex-grow items-center justify-center h-20">
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={faSpinner}
|
icon={faSpinner}
|
||||||
className="animate-spin-slow text-gray-600 flex-grow rounded-lg md:rounded-xl h-10"
|
className="animate-spin-slow text-gray-600 flex-grow rounded-lg md:rounded-xl h-10 w-10"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user