fix: Dashbaord text was not visible.

This commit is contained in:
Raja Ilayaperumal
2022-09-17 12:23:17 +05:30
parent 4a22602186
commit 272a987c92
5 changed files with 29 additions and 22 deletions

View File

@@ -41,38 +41,45 @@ export default function BuilderComponent(props) {
// Functions
useEffect(() => {
let _pollId, _mode, isCancelled = false;
if (pathParams && pathParams?.[0]) {
setPollId(pathParams[0]);
_pollId = pathParams[0];
setPollId(_pollId);
}
if (pathParams && pathParams?.[1]) {
setMode(pathParams[1]);
_mode = pathParams[1];
setMode(_mode);
} else {
setMode("");
}
// Fetch from Gaia
if (pollId) {
if (pollId === "new") {
if (_pollId) {
if (_pollId === "new") {
// Initialize new poll
setPollObject(initializeNewPoll());
} else if (mode === "draft") {
getFileFromGaia(pollId + ".json", {}).then(
} else if (_mode === "draft") {
getFileFromGaia(_pollId + ".json", {}).then(
(response) => {
if (response) {
if (response && !isCancelled) {
setPollObject(JSON.parse(response));
}
},
(error) => {
// File does not exit in gaia
if (error && error.code == "does_not_exist") {
if (error && error.code == "does_not_exist" && !isCancelled) {
// Initialize new poll
setPollObject(initializeNewPoll());
}
});
}
}
}, [pathParams, pollId, mode]);
return () => {
isCancelled = true;
}
}, [pathParams]);
function initializeNewPoll() {
return {
@@ -382,7 +389,7 @@ export default function BuilderComponent(props) {
<Link href="/all-polls">
<a style={{ fontSize: "14px", textDecoration: "none" }} className="ballot_links">
<svg width="16" height="10" viewBox="0 0 16 10" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.42417 0.57573C5.65848 0.810044 5.65848 1.18994 5.42417 1.42426L2.44843 4.39999H14.9999C15.3313 4.39999 15.5999 4.66862 15.5999 4.99999C15.5999 5.33136 15.3313 5.59999 14.9999 5.59999H2.44843L5.42417 8.57573C5.65848 8.81005 5.65848 9.18994 5.42417 9.42426C5.18985 9.65857 4.80995 9.65857 4.57564 9.42426L0.575638 5.42426C0.341324 5.18994 0.341324 4.81004 0.575638 4.57573L4.57564 0.57573C4.80995 0.341415 5.18985 0.341415 5.42417 0.57573Z" fill="black" fill-opacity="0.7" />
<path fillRule="evenodd" clipRule="evenodd" d="M5.42417 0.57573C5.65848 0.810044 5.65848 1.18994 5.42417 1.42426L2.44843 4.39999H14.9999C15.3313 4.39999 15.5999 4.66862 15.5999 4.99999C15.5999 5.33136 15.3313 5.59999 14.9999 5.59999H2.44843L5.42417 8.57573C5.65848 8.81005 5.65848 9.18994 5.42417 9.42426C5.18985 9.65857 4.80995 9.65857 4.57564 9.42426L0.575638 5.42426C0.341324 5.18994 0.341324 4.81004 0.575638 4.57573L4.57564 0.57573C4.80995 0.341415 5.18985 0.341415 5.42417 0.57573Z" fill="black" fillOpacity="0.7" />
</svg>
{' '}
Back
@@ -437,7 +444,7 @@ export default function BuilderComponent(props) {
<Button className={"action_secondary_btn " + styles.builder_option_delete} onClick={() => { deleteOption(index); }}>
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.475 15.375C5.1 15.375 4.78125 15.2438 4.51875 14.9813C4.25625 14.7188 4.125 14.4 4.125 14.025V4.5H3.9375C3.775 4.5 3.64075 4.44675 3.53475 4.34025C3.42825 4.23425 3.375 4.1 3.375 3.9375C3.375 3.775 3.42825 3.64075 3.53475 3.53475C3.64075 3.42825 3.775 3.375 3.9375 3.375H6.75C6.75 3.1875 6.8155 3.03125 6.9465 2.90625C7.078 2.78125 7.2375 2.71875 7.425 2.71875H10.575C10.7625 2.71875 10.922 2.78125 11.0535 2.90625C11.1845 3.03125 11.25 3.1875 11.25 3.375H14.0625C14.225 3.375 14.3595 3.42825 14.466 3.53475C14.572 3.64075 14.625 3.775 14.625 3.9375C14.625 4.1 14.572 4.23425 14.466 4.34025C14.3595 4.44675 14.225 4.5 14.0625 4.5H13.875V14.025C13.875 14.4 13.7438 14.7188 13.4813 14.9813C13.2188 15.2438 12.9 15.375 12.525 15.375H5.475ZM5.25 4.5V14.025C5.25 14.0875 5.272 14.1407 5.316 14.1847C5.3595 14.2283 5.4125 14.25 5.475 14.25H12.525C12.5875 14.25 12.6407 14.2283 12.6847 14.1847C12.7283 14.1407 12.75 14.0875 12.75 14.025V4.5H5.25ZM7.05 12.1875C7.05 12.35 7.10325 12.4845 7.20975 12.591C7.31575 12.697 7.45 12.75 7.6125 12.75C7.775 12.75 7.9095 12.697 8.016 12.591C8.122 12.4845 8.175 12.35 8.175 12.1875V6.5625C8.175 6.4 8.122 6.2655 8.016 6.159C7.9095 6.053 7.775 6 7.6125 6C7.45 6 7.31575 6.053 7.20975 6.159C7.10325 6.2655 7.05 6.4 7.05 6.5625V12.1875ZM9.825 12.1875C9.825 12.35 9.878 12.4845 9.984 12.591C10.0905 12.697 10.225 12.75 10.3875 12.75C10.55 12.75 10.6845 12.697 10.791 12.591C10.897 12.4845 10.95 12.35 10.95 12.1875V6.5625C10.95 6.4 10.897 6.2655 10.791 6.159C10.6845 6.053 10.55 6 10.3875 6C10.225 6 10.0905 6.053 9.984 6.159C9.878 6.2655 9.825 6.4 9.825 6.5625V12.1875ZM5.25 4.5V14.025C5.25 14.0875 5.272 14.1407 5.316 14.1847C5.3595 14.2283 5.4125 14.25 5.475 14.25H5.25V4.5Z" fill="black" fill-opacity="0.6" />
<path d="M5.475 15.375C5.1 15.375 4.78125 15.2438 4.51875 14.9813C4.25625 14.7188 4.125 14.4 4.125 14.025V4.5H3.9375C3.775 4.5 3.64075 4.44675 3.53475 4.34025C3.42825 4.23425 3.375 4.1 3.375 3.9375C3.375 3.775 3.42825 3.64075 3.53475 3.53475C3.64075 3.42825 3.775 3.375 3.9375 3.375H6.75C6.75 3.1875 6.8155 3.03125 6.9465 2.90625C7.078 2.78125 7.2375 2.71875 7.425 2.71875H10.575C10.7625 2.71875 10.922 2.78125 11.0535 2.90625C11.1845 3.03125 11.25 3.1875 11.25 3.375H14.0625C14.225 3.375 14.3595 3.42825 14.466 3.53475C14.572 3.64075 14.625 3.775 14.625 3.9375C14.625 4.1 14.572 4.23425 14.466 4.34025C14.3595 4.44675 14.225 4.5 14.0625 4.5H13.875V14.025C13.875 14.4 13.7438 14.7188 13.4813 14.9813C13.2188 15.2438 12.9 15.375 12.525 15.375H5.475ZM5.25 4.5V14.025C5.25 14.0875 5.272 14.1407 5.316 14.1847C5.3595 14.2283 5.4125 14.25 5.475 14.25H12.525C12.5875 14.25 12.6407 14.2283 12.6847 14.1847C12.7283 14.1407 12.75 14.0875 12.75 14.025V4.5H5.25ZM7.05 12.1875C7.05 12.35 7.10325 12.4845 7.20975 12.591C7.31575 12.697 7.45 12.75 7.6125 12.75C7.775 12.75 7.9095 12.697 8.016 12.591C8.122 12.4845 8.175 12.35 8.175 12.1875V6.5625C8.175 6.4 8.122 6.2655 8.016 6.159C7.9095 6.053 7.775 6 7.6125 6C7.45 6 7.31575 6.053 7.20975 6.159C7.10325 6.2655 7.05 6.4 7.05 6.5625V12.1875ZM9.825 12.1875C9.825 12.35 9.878 12.4845 9.984 12.591C10.0905 12.697 10.225 12.75 10.3875 12.75C10.55 12.75 10.6845 12.697 10.791 12.591C10.897 12.4845 10.95 12.35 10.95 12.1875V6.5625C10.95 6.4 10.897 6.2655 10.791 6.159C10.6845 6.053 10.55 6 10.3875 6C10.225 6 10.0905 6.053 9.984 6.159C9.878 6.2655 9.825 6.4 9.825 6.5625V12.1875ZM5.25 4.5V14.025C5.25 14.0875 5.272 14.1407 5.316 14.1847C5.3595 14.2283 5.4125 14.25 5.475 14.25H5.25V4.5Z" fill="black" fillOpacity="0.6" />
</svg>
</Button>
</div>
@@ -449,7 +456,7 @@ export default function BuilderComponent(props) {
<Button style={{ width: "100%" }} className="action_dashed_btn" onClick={() => { addOption(); }}>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="12" fill="#ECEFF1" />
<path d="M12 8V12M12 16V12M12 12H16M12 12H8" stroke="black" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" />
<path d="M12 8V12M12 16V12M12 12H16M12 12H8" stroke="black" strokeWidth="1.2" strokeLinecap="round" strokeLinejoin="round" />
</svg>
</Button>
</div>

View File

@@ -53,14 +53,14 @@ export function DashboardNavBarComponent() {
isUserSignedIn ?
<div style={{ display: "flex", gap: "20px", alignItems: "center" }}>
<div style={{ margin: "10px 0" }}>
<a href="/builder/new" style={{ color: "black", textDecoration: "none" }}>
<Link href="/builder/new">
<Button className="action_secondary_btn">
<svg style={{ width: "12px" }} viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fillRule="evenodd" clipRule="evenodd" d="M5.30005 0.299988C5.63917 0.299988 5.91408 0.574901 5.91408 0.914023V4.68595H9.68601C10.0251 4.68595 10.3 4.96087 10.3 5.29999C10.3 5.63911 10.0251 5.91402 9.68601 5.91402H5.91408V9.68595C5.91408 10.0251 5.63917 10.3 5.30005 10.3C4.96093 10.3 4.68601 10.0251 4.68601 9.68595V5.91402H0.914084C0.574962 5.91402 0.300049 5.63911 0.300049 5.29999C0.300049 4.96087 0.574962 4.68595 0.914084 4.68595H4.68601V0.914023C4.68601 0.574901 4.96093 0.299988 5.30005 0.299988Z" fill="black" />
</svg>
New Poll
</Button>
</a>
</Link>
</div>
{/* <div className="d-none d-md-block" style={{ margin: "10px 0" }}>

File diff suppressed because one or more lines are too long

View File

@@ -212,7 +212,7 @@ export default function PollComponent(props) {
<Form.Control type="number" name={option.id}
min="0"
onChange={handleChangeVote}
style={{ marginLeft: "10px", width: "100px" }} />
style={{ marginLeft: "10px", width: "100px" }} placeholder="0" />
</td>
</tr>
))

View File

@@ -42,7 +42,7 @@
color: rgba(0, 0, 0, 1);
}
.dropdown-toggle::after {
content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' strokeLinecap='round' strokeLinejoin='round' strokeWidth='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
width: 12px;
margin-top: 3px;
margin-left: 0px;