Changes to datagrid
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
import { useState, useEffect } from '@wordpress/element';
|
||||
import {Icon, chevronDownSmall} from '@wordpress/icons';
|
||||
|
||||
import { Button, Modal } from '@wordpress/components';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import LCPDataGrid from './LCPDataGrid';
|
||||
@ -49,7 +51,7 @@ const LCPDatasetBuilder = ({ attributes, setAttributes }) => {
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() => setIsOpen(true)}
|
||||
style={{ marginBottom: '10px', width: '100%' }}
|
||||
style={{ marginBottom: '10px', width: '100%', }}
|
||||
>
|
||||
{__('Edit Dataset', 'lcp-visualize')}
|
||||
</Button>
|
||||
@ -58,27 +60,49 @@ const LCPDatasetBuilder = ({ attributes, setAttributes }) => {
|
||||
<Modal
|
||||
onRequestClose={() => setIsOpen(false)}
|
||||
title={__('Dataset Builder', 'lcp-visualize')}
|
||||
style={{ width: '90vw', height: '90vh' }}
|
||||
style={{ width: '90vw', height: '90vh',
|
||||
background:'#efefef',
|
||||
padding:'0px',
|
||||
}}
|
||||
>
|
||||
<div style={{ height: 'calc(90vh - 40px)', padding: '20px' }}>
|
||||
<div style={{ height: 'calc(90vh - 40px)', padding: '0px' }}>
|
||||
{/* Tabs */}
|
||||
<div style={{ display: 'flex', marginBottom: '20px' }}>
|
||||
<div style={{ display: 'flex' }}>
|
||||
{datasets.map((dataset, index) => (
|
||||
<button
|
||||
key={index}
|
||||
|
||||
onClick={() => setActiveTab(index)} // Set the active tab
|
||||
style={{
|
||||
padding: '10px 20px',
|
||||
margin: '0 5px',
|
||||
backgroundColor: activeTab === index ? '#007cba' : '#f1f1f1',
|
||||
display: 'flex',
|
||||
alignItems:'center',
|
||||
justifyContent:'center',
|
||||
position: 'relative',
|
||||
minWidth: '100px',
|
||||
height: '35px',
|
||||
lineHeight: '35px',
|
||||
padding: '0 10px',
|
||||
margin: '0 3px',
|
||||
backgroundColor: '#fff',
|
||||
border: '1px solid #ccc',
|
||||
borderBottomColor: activeTab === index ? '#fff' : '#ccc',
|
||||
borderRadius: '3px',
|
||||
color: activeTab === index ? 'white' : 'black',
|
||||
border: '1px solid #ccc',
|
||||
borderRadius: '5px',
|
||||
cursor: 'pointer',
|
||||
transition: 'background-color 0.3s ease',
|
||||
}}
|
||||
>
|
||||
{dataset.name}
|
||||
> <span style={{
|
||||
display: 'inline-block',
|
||||
marginRight: '5px',
|
||||
color: activeTab === index ? '#333' : '#aaa',
|
||||
fontWeight: 'bold'
|
||||
}}>
|
||||
{dataset.name}
|
||||
</span>
|
||||
<Icon icon={ chevronDownSmall } style={{position:'relative',top:'0px'}} />
|
||||
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user