|
2 | 2 | import QRCode from 'qrcode';
|
3 | 3 | import { getContext, setContext } from 'svelte';
|
4 | 4 | import {
|
| 5 | + Accordion, |
| 6 | + AccordionItem, |
5 | 7 | Button,
|
6 | 8 | Card,
|
7 | 9 | CardHeader,
|
|
84 | 86 | shlClient.deleteShl($shlStore);
|
85 | 87 | toggle();
|
86 | 88 | // TODO: Implement post-deactivation flow
|
87 |
| - location.reload(true); |
| 89 | + location.reload(); |
88 | 90 | }
|
89 | 91 |
|
90 |
| - async function renewShl() {} |
| 92 | + let pasteHeader = "Click here to see how"; |
| 93 | + function updatePasteHeader({ detail }) { |
| 94 | + pasteHeader = detail ? "Click here to close" : "Click here to see how"; |
| 95 | + } |
| 96 | + let qrHeader = "Click here to see how"; |
| 97 | + function updateQRHeader({ detail }) { |
| 98 | + qrHeader = detail ? "Click here to close" : "Click here to see how"; |
| 99 | + } |
91 | 100 | </script>
|
92 | 101 | <div transition:fade>
|
93 | 102 | <Row class="justify-content-center">
|
|
111 | 120 | {/if}
|
112 | 121 | </Button>
|
113 | 122 | </Col>
|
| 123 | + <Col xs="5"> |
| 124 | + {#await href then href} |
| 125 | + <Button size="sm" color="success" {href} target="_blank"> |
| 126 | + <Icon name="box-arrow-up-right" /> Open Report |
| 127 | + </Button> |
| 128 | + {/await} |
| 129 | + </Col> |
114 | 130 | </Row>
|
115 | 131 | <li>
|
116 | 132 | Then, open your email and start a new message to the person you want to send it to.
|
117 | 133 | </li>
|
118 | 134 | <li>
|
119 |
| - Paste the link into the body of the email. Here’s how: After you have clicked the button |
120 |
| - above, right-click, then choose “Paste” from the pop-up menu. Or, if you’re using a PC, |
121 |
| - press the Ctrl and V buttons at the same time. On a Mac, press Command and V. |
| 135 | + Paste the link into the body of the email. |
| 136 | + <Accordion> |
| 137 | + <AccordionItem on:toggle={updatePasteHeader}> |
| 138 | + <h6 slot="header" class="my-2">{pasteHeader}</h6> |
| 139 | + After you have clicked the button |
| 140 | + above, right-click, then choose “Paste” from the pop-up menu. Or, if you’re using a PC, |
| 141 | + press the Ctrl and V buttons at the same time. On a Mac, press Command and V. |
| 142 | + </AccordionItem> |
| 143 | + </Accordion> |
122 | 144 | </li>
|
123 | 145 | <li>
|
124 | 146 | Send the email. The person you send it to will receive the link to be able to see your
|
|
127 | 149 | </ul>
|
128 | 150 | </li>
|
129 | 151 | <li>
|
130 |
| - <strong>Share a QR code:</strong> Point your phone’s camera at the QR code so that it's clearly |
131 |
| - visible within your smartphone's screen. The phone automatically scans the code. On some QR readers, |
132 |
| - you have to tap a button to scan the code. If necessary, tap the button. Your smartphone |
133 |
| - reads the code and navigates to a page showing your Choices Report. |
| 152 | + <strong>Share a QR code:</strong> |
134 | 153 | </li>
|
| 154 | + <Accordion> |
| 155 | + <AccordionItem on:toggle={updateQRHeader}> |
| 156 | + <h6 slot="header" class="my-2">{qrHeader}</h6> |
| 157 | + <Row> |
| 158 | + <Col> |
| 159 | + Point your phone’s camera at the QR code so that it's clearly |
| 160 | + visible within your smartphone's screen. The phone automatically scans the code. On some QR readers, |
| 161 | + you have to tap a button to scan the code. If necessary, tap the button. Your smartphone |
| 162 | + reads the code and navigates to a page showing your Choices Report. |
| 163 | + </Col> |
| 164 | + <Col> |
| 165 | + <img src="/img/qrphone.png" alt="Scan a QR Code"/> |
| 166 | + </Col> |
| 167 | + </Row> |
| 168 | + </AccordionItem> |
| 169 | + </Accordion> |
135 | 170 | </ol>
|
136 | 171 | <Row class="justify-content-center mx-4">
|
137 | 172 | <Col>
|
138 | 173 | <Row class="justify-content-center">
|
139 | 174 | <Card class="mb-2 p-0" color="light">
|
140 |
| - <CardHeader> |
141 |
| - <strong> |
142 |
| - {#if expDisplay} |
143 |
| - {#if exp > today} |
144 |
| - Expires {expDisplay} |
145 |
| - {:else} |
146 |
| - <span class="text-danger">Expired {expDisplay}</span> |
147 |
| - {/if} |
148 |
| - {/if} |
149 |
| - </strong> |
150 |
| - </CardHeader> |
151 | 175 | <CardBody>
|
152 | 176 | <CardText>
|
153 | 177 | {#await qrCode then qrImage}
|
|
173 | 197 | </CardText>
|
174 | 198 | </CardBody>
|
175 | 199 | <CardFooter>
|
176 |
| - {#await href then href} |
177 |
| - <Row class="justify-content-center mx-auto"> |
178 |
| - <Button size="sm" color="success" {href} target="_blank"> |
179 |
| - <Icon name="box-arrow-up-right" /> View Report |
180 |
| - </Button> |
181 |
| - </Row> |
182 |
| - {/await} |
| 200 | + <strong> |
| 201 | + {#if expDisplay} |
| 202 | + {#if exp > today} |
| 203 | + Expires {expDisplay} |
| 204 | + {:else} |
| 205 | + <span class="text-danger">Expired {expDisplay}</span> |
| 206 | + {/if} |
| 207 | + {/if} |
| 208 | + </strong> |
183 | 209 | </CardFooter>
|
184 | 210 | </Card>
|
185 | 211 | </Row>
|
|
0 commit comments