Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsive button #251

Merged
merged 9 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/components/DevAreaTools/JSONFormatter.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { Input, Button, Alert } from 'antd';
import JSONPretty from 'react-json-pretty'; // You might need to install this library for pretty JSON output
import 'react-json-pretty/themes/monikai.css'; // Optional: import a theme for JSONPretty
import JSONPretty from 'react-json-pretty';
import 'react-json-pretty/themes/monikai.css';
import { toast } from 'sonner';

const JSONFormatter = () => {
Expand Down Expand Up @@ -39,29 +39,29 @@ const JSONFormatter = () => {
};

return (
<div className='p-5'>
<h2 className='text-xl font-bold mb-4'>JSON Formatter</h2>
<div className="p-5">
<h2 className="text-xl font-bold mb-4">JSON Formatter</h2>
<Input.TextArea
value={jsonInput}
onChange={(e) => setJsonInput(e.target.value)}
placeholder="Paste your JSON here"
autoSize={{ minRows: 10 }}
className='mb-4 dark:bg-dark dark:text-white'
className="mb-4 dark:bg-dark dark:text-white"
/>
<div className='mb-4'>
<Button onClick={handleFormat} type="primary" className='mr-2'>
<div className="flex gap-2 mb-4">
<Button onClick={handleFormat} type="primary" className="mb-2">
Format JSON
</Button>
<Button onClick={handleClear} type="default">
<Button onClick={handleClear} type="default" className="mb-2">
Clear
</Button>
<Button onClick={handleCopy} type="default">
<Button onClick={handleCopy} type="default" className="mb-2">
Copy to Clipboard
</Button>
</div>
{error && <Alert message="Error" description={error} type="error" className='mb-4' />}
{error && <Alert message="Error" description={error} type="error" className="mb-4" />}
{formattedJson && (
<div className='bg-dark p-4 rounded-md'>
<div className="bg-dark p-4 rounded-md">
<JSONPretty data={formattedJson} onCopy={(data) => navigator.clipboard.writeText(JSON.stringify(data, null, 2))} />
</div>
)}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Search/SearchInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ function SearchInput({ search, setSearch, setType }) {
}}
/>



<button
className={`focus:outline-none ${!search ? "hidden" : "block"}`}
onClick={() => setSearch("")}
Expand Down