auto-fill search bar for token and wrap input fields in single div

This commit is contained in:
mngshm
2025-01-13 16:21:33 +05:30
parent f0789b1fca
commit cfe86b00aa
2 changed files with 20 additions and 13 deletions

View File

@@ -77,9 +77,9 @@
}
.text-fields {
display: flex;
justify-content: row;
gap: 20px;
display: flex;
justify-content: row;
gap: 20px;
}
.fetch-button-container button {
background-color: #00b33c;
@@ -225,10 +225,10 @@
margin-top: 16px;
}
/* MUi Component Custom CSS */
/* MUi Component Custom CSS */
css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input {
padding: none;
margin: none;
padding: none;
margin: none;
}
/* Mobile */
@@ -249,7 +249,7 @@ css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input {
gap: 25px;
}
.text-fields {
width: fit-content;
width: fit-content;
flex-direction: column;
gap: 20px;
justify-content: center;

View File

@@ -228,11 +228,20 @@ const App: React.FC = () => {
const handleTabChange = (
_event: React.SyntheticEvent,
newValue: number,
newValue: number,
) => {
setTabValue(newValue);
};
useEffect(() => {
const searchParam = new URLSearchParams(window.location.search)
const userToken = searchParam.get('token')
if (userToken) {
setLocalToken(userToken);
setToken(userToken);
}, [])
return (
<div className="container">
<div>
@@ -244,11 +253,10 @@ const App: React.FC = () => {
rel="noopener noreferrer"
className="link-text"
>
Ente Dashboard
staff.ente.io
</a>
<div class="text-fields">
<TextField
<div className="text-fields">
<TextField
label="Token"
value={localToken}
onChange={(e) => {
@@ -272,7 +280,6 @@ const App: React.FC = () => {
/>
</div>
<div className="fetch-button-container">
<Button
variant="contained"
onClick={() => {