Skip to content

Commit 153ea53

Browse files
authored
Merge pull request #120 from weaponsforge/dev
v3.0.7
2 parents 1f54457 + a845679 commit 153ea53

File tree

3 files changed

+57
-19
lines changed

3 files changed

+57
-19
lines changed

README.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,24 @@ This project creates rich CSS-styled blog-like **Posts** or **Card-like** thumbn
44

55
It also features a lightweight Content Management System (CMS) for creating and managing Google Site embeddable blog-like **Posts** and **Card** content.
66

7+
### Online App Demo
8+
9+
#### Production App
10+
https://weaponsforge.github.io/climate-profile-full/
11+
12+
#### Development (Playground) App
13+
https://climate-profile-dev.web.app/
14+
15+
```
16+
EXAMPLE USER (Development App Only)
17+
18+
password: useruser
19+
```
20+
721
### Using with Google Sites
822

23+
### A. Embed a File Card
24+
925
1. Copy a File Card's `IFrame Embed URL`.
1026
2. Paste the `IFrame Embed URL` in Google Site's **Embed from the web** - By URL input prompt.
1127
3. Preview or Publish the Google Site draft page.
@@ -15,19 +31,18 @@ https://sites.google.com/view/gsites-embed-app/home
1531

1632
![gsites-embed-03-ez-optimized](https://github.com/weaponsforge/climate-profile-full/assets/56998001/21c07402-904d-4e41-9988-9108c8c683cc)
1733

18-
### Online Demo
34+
### B. Embed a Full Page Containing a Group of File Cards
1935

20-
#### Production App
21-
https://weaponsforge.github.io/climate-profile-full/
36+
1. Copy a File Card's `Cards Gallery URL`.
37+
2. Create a **Full page embed** Google Site draft page.
38+
3. Press the **Add embed** button in the resulting blank page and paste the `Cards Gallery URL` in the **Embed from the web** - By URL input prompt.
39+
- This page will display all File Cards with similar `"category"` field value like the current Card.
40+
4. Preview or Publish the Google Site draft page.
2241

23-
#### Development App
24-
https://climate-profile-dev.web.app/
42+
Google Sites Sample Web page:<br>
43+
https://sites.google.com/view/gsites-embed-app/full-page
2544

26-
```
27-
EXAMPLE USER (Development App Only)
28-
29-
password: useruser
30-
```
45+
![gsites-full-embed-ez](https://github.com/weaponsforge/climate-profile-full/assets/56998001/dce2c297-3e3d-4073-a9f2-5f51a2590a91)
3146

3247
## Requirements
3348

client/components/common/ui/smartnotification/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function SmartNotification () {
2727
{(open && notification !== '') &&
2828
<Snackbar
2929
open={open}
30-
autoHideDuration={4000}
30+
autoHideDuration={2000}
3131
onClose={() => dispatch(resetMessage())}
3232
sx={{
3333
maxWidth: '600px',

client/features/filecards/components/formitemsview/index.js

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useCallback, useEffect, useMemo } from 'react'
2-
import { useDispatch } from 'react-redux'
2+
import { useDispatch, useSelector } from 'react-redux'
33
import Link from 'next/link'
44
import PropTypes from 'prop-types'
55

@@ -20,17 +20,20 @@ import { MESSAGE_SEVERITY } from '@/store/app/appSlice'
2020
function FormItemsView ({ card }) {
2121
const [embedUrl, setEmbedUrl] = useState('')
2222
const dispatch = useDispatch()
23+
const notification = useSelector(state => state.app.notification)
2324
const collapse = useMediaQuery('(max-width:1100px)')
2425

2526
const subDirectory = (process.env.NEXT_PUBLIC_BASE_PATH !== '')
2627
? process.env.NEXT_PUBLIC_BASE_PATH
2728
: ''
2829

29-
const incrementTimestamp = useCallback(() => {
30+
const incrementTimestamp = useCallback((isCard = true) => {
3031
const timestamp = Math.floor((new Date()).getTime() / 1000)
3132

3233
return (card !== null)
33-
? `${window.location.origin}${subDirectory}/cards/embed?id=${card.id}&ts=${timestamp}`
34+
? (isCard)
35+
? `${window.location.origin}${subDirectory}/cards/embed?id=${card.id}&ts=${timestamp}`
36+
: `${window.location.origin}${subDirectory}/cards/gallery?category=${card.category}&ts=${timestamp}`
3437
: window.location.origin
3538
}, [card, subDirectory])
3639

@@ -41,12 +44,12 @@ function FormItemsView ({ card }) {
4144
}, [card, subDirectory])
4245

4346
useEffect(() => {
44-
const embed = incrementTimestamp()
47+
const embed = incrementTimestamp(true)
4548
setEmbedUrl(embed)
4649
}, [incrementTimestamp])
4750

48-
const copyToClipboard = () => {
49-
const embed = incrementTimestamp()
51+
const copyToClipboard = (isCard = true) => {
52+
const embed = incrementTimestamp(isCard)
5053
setEmbedUrl(embed)
5154
navigator.clipboard.writeText(embed)
5255

@@ -122,13 +125,19 @@ function FormItemsView ({ card }) {
122125
</Link>
123126
</Typography>
124127

125-
<Button size="small" disableElevation variant="contained" color="secondary" onClick={copyToClipboard}>
128+
<Button
129+
size="small"
130+
disableElevation variant="contained"
131+
color="secondary"
132+
disabled={notification !== ''}
133+
onClick={() => copyToClipboard(true)}
134+
>
126135
<ContentPasteIcon sx={{ fontSize: '20px' }} />
127136
</Button>
128137
</Box>
129138

130139
<Typography variant="caption">
131-
Press the Copy Button to copy the IFrame embed URL to clipboard
140+
Press the Copy Button to copy this card&apos;s IFrame embed URL to clipboard
132141
</Typography>
133142

134143
{/** Cards Gallery URL */}
@@ -143,7 +152,21 @@ function FormItemsView ({ card }) {
143152
{cardGalleryURL}
144153
</Link>
145154
</Typography>
155+
156+
<Button
157+
size="small"
158+
disableElevation variant="contained"
159+
color="secondary"
160+
disabled={notification !== ''}
161+
onClick={() => copyToClipboard(false)}
162+
>
163+
<ContentPasteIcon sx={{ fontSize: '20px' }} />
164+
</Button>
146165
</Box>
166+
167+
<Typography variant="caption">
168+
Press the Copy Button to copy the <b>{card.category}</b> cards gallery embed URL to clipboard
169+
</Typography>
147170
</div>
148171
</Box>
149172
</Box>

0 commit comments

Comments
 (0)