Skip to content

Commit 3a09f6e

Browse files
authored
release 3.46.0 (#1228)
New production release. 🎉
1 parent 1ecfbc7 commit 3a09f6e

33 files changed

Lines changed: 1138 additions & 472 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "d.buzz-client",
33
"homepage": ".",
4-
"version": "3.45.1",
4+
"version": "3.46.0",
55
"private": true,
66
"dependencies": {
77
"3id-blockchain-utils": "^1.3.1",
@@ -163,4 +163,4 @@
163163
"browser": {
164164
"process": "process/browser.js"
165165
}
166-
}
166+
}

public/widgets/buzzWidget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,4 @@
179179
__dbuzzwidget.i();
180180
}
181181
};
182-
}));
182+
}));

public/widgets/buzz_button.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
const buzzButton=new BuzzButton();buzzButton.i()})
2727
</script>
2828
</body>
29-
</html>
29+
</html>

src/App.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ const App = () => {
3636
redirectOldLinks()
3737
}, [])
3838

39+
if(window.location.host !== 'd.buzz'){
40+
const passwordWall = localStorage.getItem('passwordWall')
41+
if(passwordWall !== "dbuzz"){
42+
let passwordW = null
43+
while(passwordW == null || passwordW !== "dbuzz"){
44+
passwordW = prompt("The password is dbuzz (all lower-case).")
45+
}
46+
localStorage.setItem('passwordWall', passwordW)
47+
}
48+
}
49+
3950
return (
4051
<React.Fragment>
4152
<React.Suspense fallback={<span> </span>}>

src/components/common/HelmetGenerator/index.js

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import React, { useState, useEffect } from 'react'
22
import { Helmet } from 'react-helmet'
3-
import { checkIfImage } from 'services/api'
43
import removeMd from 'remove-markdown'
5-
import { parseUrls, stripHtml } from 'services/helper'
4+
import { stripHtml } from 'services/helper'
65

76
const HelmetGenerator = (props) => {
87
const {content, user, page = 'content'} = props
98
const [title, setTitle] = useState()
109
const [description, setDescription] = useState()
11-
const [image, setImage] = useState()
1210
const url = window.location.href
1311

1412
useEffect(() => {
@@ -18,7 +16,6 @@ const HelmetGenerator = (props) => {
1816
const stripContent = stripHtml(removeMd(content))
1917
let title = stripContent
2018
let description = stripContent
21-
const links = parseUrls(content)
2219

2320
if(`${title}`.length > 80) {
2421
title = `${title.substr(0, 80)} ...`
@@ -31,22 +28,10 @@ const HelmetGenerator = (props) => {
3128
}
3229

3330
description = `${description} | by ${user}`
34-
const avatarLink = `https://images.hive.blog/u/${user}/avatar/large`
3531

3632
setTitle(title)
3733
setDescription(description)
3834

39-
if(links.length !== 0) {
40-
const result = await checkIfImage(links)
41-
const { hasImage, imageUrl } = result
42-
if(hasImage) {
43-
setImage(`https://images.hive.blog/0x0/${imageUrl}`)
44-
} else {
45-
setImage(avatarLink)
46-
}
47-
} else {
48-
setImage(avatarLink)
49-
}
5035
window.prerenderReady = true
5136
}
5237

@@ -65,16 +50,22 @@ const HelmetGenerator = (props) => {
6550
<Helmet>
6651
<title>{title}</title>
6752
<meta property="description" content={description} />
68-
<meta property="image" content={image} />
53+
<meta property="image" content="https://d.buzz/dbuzz.svg" />
54+
<meta property="image:width" content="1200" />
55+
<meta property="image:height" content="628" />
6956
<meta property="og:url" content={url} />
7057
<meta property="og:title" content={title} />
7158
<meta property="og:description" content={description} />
72-
<meta property="og:image" content={image} />
59+
<meta property="og:image" content="https://d.buzz/dbuzz.svg" />
60+
<meta property="og:image:width" content="1200" />
61+
<meta property="og:image:height" content="628" />
7362
<meta property="title" content={title} />
7463
<meta property="twitter:url" content={url} />
7564
<meta property="twitter:title" content={title} />
7665
<meta property="twitter:description" content={description} />
77-
<meta property="twitter:image" ccontent={image} />
66+
<meta property="twitter:image" content="https://d.buzz/dbuzz.svg" />
67+
<meta property="twitter:image:width" content="1200" />
68+
<meta property="twitter:image:height" content="628" />
7869
</Helmet>
7970
)}
8071
{page !== 'content' && (

src/components/common/ImageCropper/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ const useStyles = createUseStyles(theme => ({
6262
background: '#F5F8FA',
6363
marginRight: 8,
6464
color: '#000000 !important',
65-
65+
6666
'&:hover': {
6767
background: '#EDF0F2',
6868
},
69-
69+
7070
'&:active': {
7171
background: '#EDF0F2 !important',
7272
},
@@ -79,7 +79,7 @@ const useStyles = createUseStyles(theme => ({
7979
},
8080
}))
8181

82-
const ImageCropper = ({ isOpen, onClose, src, onCropComplete }) => {
82+
const ImageCropper = ({ isOpen, onClose, src, onCropComplete, username }) => {
8383
const classes = useStyles()
8484
const [cropData, setCropData] = useState("#")
8585
const cropperRef = useRef(null)
@@ -90,7 +90,7 @@ const ImageCropper = ({ isOpen, onClose, src, onCropComplete }) => {
9090
const croppedImage = cropper.getCroppedCanvas().toDataURL()
9191
setCropData(croppedImage)
9292
if (onCropComplete) {
93-
onCropComplete(croppedImage)
93+
onCropComplete(croppedImage ,username)
9494
}
9595
console.log(cropData)
9696
} else {

src/components/common/MoreMenu/index.js

Lines changed: 73 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import React, { useState, useEffect } from 'react'
22
import Menu from '@material-ui/core/Menu'
3-
import MenuItem from '@material-ui/core/MenuItem'
3+
import ListSubheader from '@material-ui/core/ListSubheader'
4+
import List from '@material-ui/core/List'
5+
import ListItem from '@material-ui/core/ListItem'
6+
import ListItemText from '@material-ui/core/ListItemText'
7+
import Collapse from '@material-ui/core/Collapse'
8+
import ExpandLess from '@material-ui/icons/ExpandLess'
9+
import ExpandMore from '@material-ui/icons/ExpandMore'
10+
import Divider from '@material-ui/core/Divider'
411

512
const MoreMenu = (props) => {
613
const {
@@ -24,7 +31,11 @@ const MoreMenu = (props) => {
2431
setcallFunc(onClick)
2532
setOverflow('scroll')
2633
}
27-
34+
35+
const handleClickCollapse = (onClick) => () => {
36+
setcallFunc(onClick)
37+
}
38+
2839
useEffect(() => {
2940
// console.log(open, themeModal, switchUserModal)
3041
setcallFunc(callFunc)
@@ -36,19 +47,74 @@ const MoreMenu = (props) => {
3647
}
3748
// eslint-disable-next-line
3849
}, [open, themeModal, switchUserModal])
39-
4050
return (
4151
<Menu
4252
style={{ zIndex: 3500 }}
4353
anchorEl={() => anchor.current}
4454
open={open}
4555
onClose={onClose}
4656
className={className}
47-
transformOrigin={{vertical: 'bottom', horizontal: 'top'}}
57+
transformOrigin={{vertical: 'top', horizontal: 'top'}}
4858
>
49-
{items.map(({onClick, text, visible}) => (
50-
visible && <MenuItem onClick={handleMenuClosing(onClick)} key={text} style={{ minWidth: 150 }}>{text}</MenuItem>
51-
))}
59+
<List
60+
component="nav"
61+
aria-labelledby="advanced-subheader"
62+
subheader={<ListSubheader component="div" id="advanced-subheader" style={{ fontSize: '20px !important', fontWeight: '700 !important' }}>
63+
Advanced
64+
</ListSubheader>}
65+
style={{
66+
maxHeight: '400px', // Adjust this value based on your needs
67+
overflowY: 'auto', // This makes the list scrollable
68+
}}
69+
>
70+
<Divider />
71+
{items.map(({onClick, text, visible, subItems, collapse}) => (
72+
visible &&
73+
(
74+
Object.keys(subItems).length > 0 ? (
75+
<>
76+
<ListItem button onClick={handleClickCollapse(onClick)}>
77+
{/* <ListItemIcon>
78+
<InboxIcon />
79+
</ListItemIcon> */}
80+
<ListItemText primary={text}/>
81+
{collapse ? <ExpandLess /> : <ExpandMore />}
82+
</ListItem>
83+
<Collapse in={collapse} timeout="auto" unmountOnExit>
84+
{subItems.map(({subonClick, subtext, subhref}) => (
85+
subhref === '' ?
86+
<List component="div">
87+
<ListItem onClick={handleMenuClosing(subonClick)} key={text} button>
88+
{/* <ListItemIcon>
89+
<StarBorder />
90+
</ListItemIcon> */}
91+
<ListItemText primary={subtext} />
92+
</ListItem>
93+
</List>
94+
:
95+
<List component="div">
96+
<ListItem component="a" href={subhref} target="_blank" rel="noopener noreferrer" key={text} button>
97+
{/* <ListItemIcon>
98+
<StarBorder />
99+
</ListItemIcon> */}
100+
<ListItemText primary={subtext} />
101+
</ListItem>
102+
</List>
103+
104+
))}
105+
</Collapse>
106+
</>
107+
)
108+
:
109+
<ListItem button>
110+
{/* <ListItemIcon>
111+
<InboxIcon />
112+
</ListItemIcon> */}
113+
<ListItemText onClick={handleMenuClosing(onClick)} key={text} primary={text} />
114+
</ListItem>
115+
)
116+
))}
117+
</List>
52118
</Menu>
53119
)
54120
}

src/components/common/UserDialog/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ const UserDialog = React.memo((props) => {
107107
const [author, setAuthor] = useState('')
108108
const { username, is_authenticated } = user
109109
const [shouldStayOpen, setShouldStayOpen] = useState(false)
110-
const [hasRecentlyFollowed, setHasRecentlyFollowed] = useState(false)
111-
const [hasRecentlyUnfollowed, setHasRecentlyUnfollowed] = useState(false)
110+
const [setHasRecentlyFollowed] = useState(false)
111+
const [setHasRecentlyUnfollowed] = useState(false)
112112
const [followerCount, setFollowerCount] = useState(0)
113113
const [followingCount, setFollowingCount] = useState(0)
114114
const [isFollowed, setIsFollowed] = useState(false)
@@ -214,6 +214,7 @@ const UserDialog = React.memo((props) => {
214214
broadcastNotification('success', `Successfully followed @${author}`)
215215
setHasRecentlyFollowed(true)
216216
setHasRecentlyUnfollowed(false)
217+
setIsFollowed(true)
217218
} else {
218219
broadcastNotification('error', `Failed following @${author}`)
219220
}
@@ -228,6 +229,7 @@ const UserDialog = React.memo((props) => {
228229
broadcastNotification('success', `Successfully Unfollowed @${author}`)
229230
setHasRecentlyFollowed(false)
230231
setHasRecentlyUnfollowed(true)
232+
setIsFollowed(false)
231233
} else {
232234
broadcastNotification('error', `Failed Unfollowing @${author}`)
233235
}
@@ -276,7 +278,7 @@ const UserDialog = React.memo((props) => {
276278
<div className={classes.right}>
277279
{is_authenticated && (
278280
<React.Fragment>
279-
{((!isFollowed && !hasRecentlyFollowed) || hasRecentlyUnfollowed) && (username !== author) && (
281+
{!isFollowed && (username !== author) && (
280282
<ContainedButton
281283
fontSize={14}
282284
loading={loading || detailsFetching}
@@ -288,7 +290,7 @@ const UserDialog = React.memo((props) => {
288290
onClick={followUser}
289291
/>
290292
)}
291-
{((isFollowed || hasRecentlyFollowed) && !hasRecentlyUnfollowed) && (username !== author) && (
293+
{isFollowed && (username !== author) && (
292294
<ContainedButton
293295
fontSize={14}
294296
loading={loading || detailsFetching}

src/components/elements/Icons/BookmarkIcon/index.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
import React from 'react'
22

3-
const BookmarkIcon = () => {
3+
const BookmarkIcon = ({ height = 20, top = 0, type }) => {
4+
// return (
5+
// <svg height="20" viewBox="0 0 24 24">
6+
// <g>
7+
// <path strokeWidth="0.3" stroke="rgb(101, 119, 134)" d="M4 4.5C4 3.12 5.119 2 6.5 2h11C18.881 2 20 3.12 20 4.5v18.44l-8-5.71-8 5.71V4.5zM6.5 4c-.276 0-.5.22-.5.5v14.56l6-4.29 6 4.29V4.5c0-.28-.224-.5-.5-.5h-11z"></path>
8+
// </g>
9+
// </svg>
10+
// )
411
return (
5-
<svg height="20" viewBox="0 0 24 24">
6-
<g>
7-
<path strokeWidth="0.3" stroke="rgb(101, 119, 134)" d="M4 4.5C4 3.12 5.119 2 6.5 2h11C18.881 2 20 3.12 20 4.5v18.44l-8-5.71-8 5.71V4.5zM6.5 4c-.276 0-.5.22-.5.5v14.56l6-4.29 6 4.29V4.5c0-.28-.224-.5-.5-.5h-11z"></path>
8-
</g>
9-
</svg>
12+
type === 'outline' ?
13+
<svg height="25" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
14+
<path style={{ strokeWidth: '0'}} d="M4 4.5C4 3.12 5.119 2 6.5 2h11C18.881 2 20 3.12 20 4.5v18.44l-8-5.71-8 5.71V4.5zM6.5 4c-.276 0-.5.22-.5.5v14.56l6-4.29 6 4.29V4.5c0-.28-.224-.5-.5-.5h-11z" fill="#e61c34"/>
15+
</svg>
16+
:
17+
<svg height="25" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
18+
<path style={{ strokeWidth: '0'}} d="M4 4.5C4 3.12 5.119 2 6.5 2h11C18.881 2 20 3.12 20 4.5v18.44l-8-5.71-8 5.71V4.5z" fill="#e61c34"/>
19+
</svg>
20+
1021
)
1122
}
1223

src/components/elements/Icons/CommunityIcon/index.js

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)