Skip to content

Commit

Permalink
Responsive button (#251)
Browse files Browse the repository at this point in the history
* added white color in modal

* search box tex color fixed

* color changed of search input text

* search text fixed

* button distance fixed

* issue Add space in buttons #248 solved
  • Loading branch information
PATILYASHH authored Aug 7, 2024
1 parent 12d049e commit ea08716
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
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

0 comments on commit ea08716

Please sign in to comment.