Skip to content

Commit 1a320be

Browse files
Copilotlimonte
andauthored
Add Google Maps recipe (#241)
* Initial plan * Add Google Maps recipe to recipe gallery Co-authored-by: limonte <6059356+limonte@users.noreply.github.com> * fff * chore: add link to all themes --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: limonte <6059356+limonte@users.noreply.github.com>
1 parent bd660d1 commit 1a320be

File tree

7 files changed

+51
-2
lines changed

7 files changed

+51
-2
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ jobs:
3030
- name: Check for broken links
3131
uses: lycheeverse/lychee-action@v2
3232
with:
33-
args: src/**/*.tsx --exclude https://api.github.com --exclude https://codepen.io/pen/define --exclude https://www.minisexdoll.com/anime-sexdoll/ --exclude https://www.mymasturbators.com/ --exclude https://github.com/sweetalert2/sweetalert2/commits/main --exclude https://sextoycollective.com/ --exclude https://www.pidoll.com/ --exclude https://www.uusexdoll.com/ --exclude https://www.nakedoll.com/ --exclude https://doctorclimax.com/ --exclude https://www.cloudways.com/ --exclude https://cutesexdoll.com/ --exclude https://www.buypenispump.com/ --exclude https://www.myminisexdoll.com/
33+
args: src/**/*.tsx --exclude https://api.github.com --exclude https://codepen.io/pen/define --exclude https://www.minisexdoll.com/anime-sexdoll/ --exclude https://www.mymasturbators.com/ --exclude https://github.com/sweetalert2/sweetalert2/commits/main --exclude https://sextoycollective.com/ --exclude https://www.pidoll.com/ --exclude https://www.uusexdoll.com/ --exclude https://www.nakedoll.com/ --exclude https://doctorclimax.com/ --exclude https://www.cloudways.com/ --exclude https://cutesexdoll.com/ --exclude https://www.buypenispump.com/ --exclude https://www.myminisexdoll.com/ --exclude https://www.uusextoy.com/
3434
fail: true

recipe-gallery/google-maps-src.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Swal from 'sweetalert2'
2+
import 'sweetalert2/themes/embed-iframe.css'
3+
4+
Swal.fire({
5+
theme: 'embed-iframe',
6+
title: 'Google Maps',
7+
html: '<iframe frameborder="0" src="https://maps.google.com/maps?q=New+York&t=&z=13&ie=UTF8&iwloc=&output=embed"></iframe>',
8+
showCloseButton: true,
9+
showConfirmButton: false,
10+
width: 800,
11+
})

recipe-gallery/google-maps.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Nav, Prtnr } from '../src/components'
2+
import { renderRecipe } from '../src/utils'
3+
import { Sandpack } from './components/Sandpack'
4+
5+
const src = (await import('./google-maps-src?raw')).default
6+
7+
function Recipe() {
8+
return (
9+
<>
10+
<Nav recipeGallery />
11+
<Prtnr />
12+
<h1>Google Maps</h1>
13+
14+
<p>
15+
Uses the <strong>embed-iframe</strong> theme and a simple Google Maps embed URL (no API key required).
16+
</p>
17+
18+
<p>
19+
All themes can be found in the <a href="https://sweetalert2.github.io/#themes">SweetAlert2 themes gallery</a>.
20+
</p>
21+
22+
<Sandpack
23+
files={{
24+
'/App.ts': src,
25+
}}
26+
editorHeight={300}
27+
previewHeight={600}
28+
/>
29+
</>
30+
)
31+
}
32+
33+
renderRecipe(<Recipe />)

recipe-gallery/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ function Recipe() {
6868
<li>
6969
<a href="./pdf-viewer.html">PDF Viewer</a>
7070
</li>
71+
<li>
72+
<a href="./google-maps.html">Google Maps</a>
73+
</li>
7174
</ul>
7275
</>
7376
)

src/examples/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export default {
230230
},
231231
ajaxRequest() {
232232
window.Swal.fire({
233-
title: 'Submit your Github username',
233+
title: 'Submit your GitHub username',
234234
input: 'text',
235235
inputAttributes: {
236236
autocapitalize: 'off',

tools/generate-recipe-html.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const recipes = [
2929
{ name: 'blurred-backdrop', title: 'Blurred Backdrop' },
3030
{ name: 'sidebars-drawers', title: 'Sidebars and Drawers' },
3131
{ name: 'pdf-viewer', title: 'PDF Viewer' },
32+
{ name: 'google-maps', title: 'Google Maps' },
3233
]
3334

3435
function generateHtml(title, scriptSrc) {

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default defineConfig({
3131
'blurred-backdrop': 'recipe-gallery/blurred-backdrop.html',
3232
'sidebars-drawers': 'recipe-gallery/sidebars-drawers.html',
3333
'pdf-viewer': 'recipe-gallery/pdf-viewer.html',
34+
'google-maps': 'recipe-gallery/google-maps.html',
3435
},
3536
},
3637
},

0 commit comments

Comments
 (0)