mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-07-07 02:11:25 +02:00
chore(devx-improvements): Deps upgrades + Prettier
This commit is contained in:
@@ -8,7 +8,9 @@ export interface IPreviewProps {
|
||||
url: string | null;
|
||||
}
|
||||
|
||||
export const Preview: React.FunctionComponent<IPreviewProps> = ({url}: React.PropsWithChildren<IPreviewProps>) => {
|
||||
export const Preview: React.FunctionComponent<IPreviewProps> = ({
|
||||
url
|
||||
}: React.PropsWithChildren<IPreviewProps>) => {
|
||||
const iframeRef = useRef<HTMLIFrameElement>(null);
|
||||
|
||||
const onRefresh = () => {
|
||||
@@ -22,48 +24,50 @@ export const Preview: React.FunctionComponent<IPreviewProps> = ({url}: React.Pro
|
||||
};
|
||||
|
||||
return (
|
||||
<div className='w-full h-full bg-white'>
|
||||
<div
|
||||
className="slug fixed w-full top-0 flex items-center"
|
||||
style={{
|
||||
height: "30px",
|
||||
background: "var(--vscode-editor-background)",
|
||||
borderBottom: "1px solid var(--vscode-focusBorder)"
|
||||
<div className="w-full h-full bg-white">
|
||||
<div
|
||||
className="slug fixed w-full top-0 flex items-center"
|
||||
style={{
|
||||
height: '30px',
|
||||
background: 'var(--vscode-editor-background)',
|
||||
borderBottom: '1px solid var(--vscode-focusBorder)'
|
||||
}}
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
value={url || ""}
|
||||
<input
|
||||
type="text"
|
||||
value={url || ''}
|
||||
className="w-full h-full border-0 bg-transparent text-xs py-1 px-2"
|
||||
style={{
|
||||
color: "var(--vscode-editor-foreground)"
|
||||
color: 'var(--vscode-editor-foreground)'
|
||||
}}
|
||||
disabled />
|
||||
disabled
|
||||
/>
|
||||
|
||||
<div
|
||||
<div
|
||||
className="actions absolute right-0 top-0 bottom-0 flex items-center space-x-2 px-2"
|
||||
style={{
|
||||
background: "var(--vscode-editor-background)",
|
||||
background: 'var(--vscode-editor-background)'
|
||||
}}
|
||||
>
|
||||
<button title="Refresh" onClick={onRefresh}>
|
||||
<RefreshIcon className='w-4 h-4' aria-hidden="true" />
|
||||
<RefreshIcon className="w-4 h-4" aria-hidden="true" />
|
||||
</button>
|
||||
|
||||
<button title="Open" onClick={openInBrowser} className="mr-2">
|
||||
<ExternalLinkIcon className='w-4 h-4' aria-hidden="true" />
|
||||
<ExternalLinkIcon className="w-4 h-4" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<iframe
|
||||
ref={iframeRef}
|
||||
src={url || ""}
|
||||
className={`w-full border-0`}
|
||||
style={{
|
||||
height: "calc(100% - 30px)",
|
||||
marginTop: "30px"
|
||||
}}></iframe>
|
||||
<iframe
|
||||
ref={iframeRef}
|
||||
src={url || ''}
|
||||
className={`w-full border-0`}
|
||||
style={{
|
||||
height: 'calc(100% - 30px)',
|
||||
marginTop: '30px'
|
||||
}}
|
||||
></iframe>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user