chore(Tailwind): RenderedQueryString to tailwind (#7627)

This commit is contained in:
James Gatz 2024-07-01 16:19:03 +02:00 committed by GitHub
parent 473b9afb62
commit 136db3e74b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,5 @@
import classNames from 'classnames';
import React, { FC, useEffect, useState } from 'react';
import styled from 'styled-components';
import { database as db } from '../../common/database';
import * as models from '../../models';
@ -11,25 +10,7 @@ import { getAuthObjectOrNull, isAuthEnabled } from '../../network/authentication
import { getOrInheritAuthentication } from '../../network/network';
import { buildQueryStringFromParams, joinUrlAndQueryString, smartEncodeUrl } from '../../utils/url/querystring';
import { useNunjucks } from '../context/nunjucks/use-nunjucks';
import { CopyButton as _CopyButton } from './base/copy-button';
const Wrapper = styled.div({
display: 'flex',
justifyContent: 'space-between',
overflow: 'auto',
position: 'relative',
height: '100%',
gap: 'var(--padding-sm)',
width: '100%',
});
const CopyButton = styled(_CopyButton)({
'&&': {
alignSelf: 'start',
position: 'sticky',
top: 0,
},
});
import { CopyButton } from './base/copy-button';
interface Props {
request: Request | WebSocketRequest;
@ -118,7 +99,7 @@ export const RenderedQueryString: FC<Props> = ({ request }) => {
const className = previewString === defaultPreview ? 'super-duper-faint' : 'selectable force-wrap';
return (
<Wrapper>
<div className="flex justify-between overflow-auto relative h-full gap-[var(--padding-sm)] w-full">
<span className={classNames('my-auto', className)}>{previewString}</span>
<CopyButton
@ -127,9 +108,10 @@ export const RenderedQueryString: FC<Props> = ({ request }) => {
disabled={previewString === defaultPreview}
title="Copy URL"
confirmMessage=""
className='self-start sticky top-0'
>
<i className="fa fa-copy" />
</CopyButton>
</Wrapper>
</div>
);
};