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

fix: move sign-in page to pop-up #68

Merged
merged 8 commits into from
Dec 11, 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
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"dependencies": {
"@reduxjs/toolkit": "^2.3.0",
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-redux": "^9.1.2"
Expand Down
90 changes: 0 additions & 90 deletions src/assets/js/components/options/sign-in.jsx

This file was deleted.

8 changes: 7 additions & 1 deletion src/assets/js/components/popup/popup-spinner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import React from 'react';

export const PopupSpinner = () => {
return (
<div className="page" id="working-page">
<div
className="page"
id="working-page"
style={{
height: '300px',
}}
>
<div className="align-items-center d-flex h-100 justify-content-center">
<div className="spinner spinner-border">
<span className="sr-only"></span>
Expand Down
138 changes: 76 additions & 62 deletions src/assets/js/components/popup/proposal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ import {
updateWebAsset,
State,
} from '@/main';
import { notifyAssetSaveSuccess } from '@/features/popup/popupSlice';
import {
notifyAssetSaveSuccess,
openSettings,
} from '@/features/popup/popupSlice';

export const Proposal = () => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -173,7 +176,12 @@ export const Proposal = () => {
});
}, []);

const handleSubmission = async(event) => {
const handleSettings = (event) => {
event.preventDefault();
dispatch(openSettings());
};

const handleSubmission = async (event) => {
event.preventDefault();

let currentProposal = proposal;
Expand Down Expand Up @@ -292,59 +300,59 @@ export const Proposal = () => {
}

return (
<>
<div className="page" id="proposal-page">
<form id="add-it">
<section>
<h5 id="title">{assetTitle}</h5>
</section>
<section className="bg-light">
<div
className="break-anywhere text-monospace"
id="url"
<div className="page" id="proposal-page">
<form id="add-it">
<section>
<h5 id="title">{assetTitle}</h5>
</section>
<section className="bg-light">
<div
className="break-anywhere text-monospace"
id="url"
>
{assetUrl}
</div>
</section>
<section>
<div className="form-check">
<input
className="form-check-input shadow-none"
id="with-auth-check"
type="checkbox"
checked={saveAuthentication}
onChange={(e) => setSaveAuthentication(e.target.checked)}
/>
<label
className="form-check-label"
htmlFor="with-auth-check"
>
{assetUrl}
</div>
</section>
<section>
<div className="form-check">
<input
className="form-check-input shadow-none"
id="with-auth-check"
type="checkbox"
checked={saveAuthentication}
onChange={(e) => setSaveAuthentication(e.target.checked)}
/>
<label
className="form-check-label"
htmlFor="with-auth-check"
>
Save Authentication
</label>
</div>
<SaveAuthWarning hostname={assetHostname} hidden={!saveAuthentication} />
<SaveAuthHelp />
</section>

<section id="verification" hidden={!bypassVerification}>
<div className="form-check">
<input
className="form-check-input"
id="no-verification-check"
type="checkbox"
/>
<label
className="form-check-label"
htmlFor="no-verification-check"
>
Bypass Verification
</label>
</div>
</section>
Save Authentication
</label>
</div>
<SaveAuthWarning hostname={assetHostname} hidden={!saveAuthentication} />
<SaveAuthHelp />
</section>

<section id="verification" hidden={!bypassVerification}>
<div className="form-check">
<input
className="form-check-input"
id="no-verification-check"
type="checkbox"
/>
<label
className="form-check-label"
htmlFor="no-verification-check"
>
Bypass Verification
</label>
</div>
</section>

<section>
<section>
<div className="d-flex">
<button
className="btn btn-primary w-100"
className="btn btn-primary w-100 me-1"
id="add-it-submit"
type="submit"
onClick={handleSubmission}
Expand All @@ -369,16 +377,22 @@ export const Proposal = () => {
Update Asset
</span>
</button>
<div
className="alert alert-danger mb-0 mt-3"
id="add-it-error"
hidden={!error.show}
<button
className="btn btn-primary"
onClick={handleSettings}
>
{error.message}
</div>
</section>
</form>
</div>
</>
<i className="bi bi-gear"></i>
</button>
</div>
<div
className="alert alert-danger mb-0 mt-3"
id="add-it-error"
hidden={!error.show}
>
{error.message}
</div>
</section>
</form>
</div>
);
};
Loading
Loading