Skip to content

Commit 034e1d6

Browse files
authored
Merge pull request #38 from PoglyApp/0.1.2-release
0.1.2 release
2 parents 0c3940b + fd7b6a4 commit 034e1d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1772
-424
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
 
2424
<a href="https://github.com/clockworklabs/spacetimedb"><img src="https://img.shields.io/badge/powered_by-SpacetimeDB-000000.svg?style=flat-square" /></a>
2525
&nbsp;
26-
<img src="https://img.shields.io/badge/version-v0.1.1_beta-9f9f9f.svg?style=flat-square" />
26+
<img src="https://img.shields.io/badge/version-v0.1.2_beta-9f9f9f.svg?style=flat-square" />
2727
&nbsp;
2828
<a href="https://github.com/PoglyApp/pogly-standalone/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-50C878.svg?style=flat-square" /></a>
2929
</p>

package-lock.json

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

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pogly-standalone",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"private": true,
55
"dependencies": {
66
"@clockworklabs/spacetimedb-sdk": "^0.11.0",
@@ -14,8 +14,10 @@
1414
"css-filter-converter": "^1.0.109",
1515
"prismjs": "^1.29.0",
1616
"react": "^18.2.0",
17+
"react-colorful": "^5.6.1",
1718
"react-dom": "^18.2.0",
1819
"react-draggable": "^4.4.6",
20+
"react-dropzone": "^14.2.3",
1921
"react-moveable": "^0.56.0",
2022
"react-redux": "^9.0.4",
2123
"react-router-dom": "6.4",
@@ -25,6 +27,7 @@
2527
"react-toastify": "^9.1.3",
2628
"react-twitch-embed": "^3.0.2",
2729
"react-zoom-pan-pinch": "^3.4.4",
30+
"reakeys": "^2.0.3",
2831
"styled-components": "^6.1.6",
2932
"typescript": "^4.9.5"
3033
},

server/Config/ConfigTables.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public partial struct ZIndex
5959
public int Ceiling;
6060
}
6161

62-
private const string SEVEN_TV_TENOR_REGEX = @"^https?:\/\/(www\.)?cdn\.7tv\.app(?:\/.*)?$|^https?:\/\/(www\.)?media\.tenor\.com(?:\/.*)?$";
62+
private const string SEVEN_TV_TENOR_REGEX = @"^https?:\/\/(www\.)?cdn\.7tv\.app(?:\/.*)?$|^https?:\/\/(www\.)?media\.tenor\.com(?:\/.*)?$|^https?:\/\/(www\.)?cdn\.betterttv\.net(?:\/.*)?$";
6363

6464
private const string HTML_TAG_REGEX = @"<[^>]*>";
6565
}

server/Guests/GuestReducers.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,30 @@ public static void UpdateGuestPosition(ReducerContext ctx, int positionX, int po
105105
LogLevel.Error);
106106
}
107107
}
108+
109+
[SpacetimeDB.Reducer]
110+
public static void KickGuest(ReducerContext ctx, Identity identity)
111+
{
112+
string func = "KickGuest";
113+
114+
if (!GetGuest(func, ctx.Sender, out var guest)) return;
115+
if (!GuestAuthenticated(func, guest)) return;
116+
if (!IsGuestOwner(func, ctx.Sender)) return;
117+
118+
try
119+
{
120+
var g = Guests.FindByIdentity(identity);
121+
if (g is not null)
122+
{
123+
Guests.DeleteByIdentity(identity);
124+
}
125+
}
126+
catch (Exception e)
127+
{
128+
Log($"[{func}] Encountered error kicking Guest, requested by {ctx.Sender}. " + e.Message,
129+
LogLevel.Error);
130+
}
131+
}
108132

109133
[SpacetimeDB.Reducer]
110134
public static void SetIdentityPermission(ReducerContext ctx, Identity identity, PermissionLevel permissionLevel)

src/Components/Containers/ContextMenus/GuestListContextMenu.tsx

Lines changed: 60 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Permissions from "../../../module_bindings/permissions";
66
import styled from "styled-components";
77
import SetIdentityPermissionModeratorReducer from "../../../module_bindings/set_identity_permission_moderator_reducer";
88
import ClearIdentityPermissionReducer from "../../../module_bindings/clear_identity_permission_reducer";
9+
import KickGuestReducer from "../../../module_bindings/kick_guest_reducer";
910

1011
interface IProps {
1112
contextMenu: any;
@@ -51,25 +52,36 @@ export const GuestListContextMenu = (props: IProps) => {
5152
</Paper>
5253

5354
{!selectedGuest.identity.isEqual(Identity.identity) && identityPermission?.tag === "Owner" ? (
54-
selectedGuestPermission?.tag === "Moderator" ? (
55-
<StyledMenuItem
56-
onClick={() => {
57-
ClearIdentityPermissionReducer.call(selectedGuest.identity);
58-
handleClose();
59-
}}
60-
>
61-
Revoke Moderator
62-
</StyledMenuItem>
63-
) : (
64-
<StyledMenuItem
65-
onClick={() => {
66-
SetIdentityPermissionModeratorReducer.call(selectedGuest.identity);
67-
handleClose();
68-
}}
69-
>
70-
Grant Moderator
71-
</StyledMenuItem>
72-
)
55+
<>
56+
{selectedGuestPermission?.tag === "Moderator" ? (
57+
<StyledMenuItemOrange
58+
onClick={() => {
59+
ClearIdentityPermissionReducer.call(selectedGuest.identity);
60+
handleClose();
61+
}}
62+
sx={{color:"#008205"}}
63+
>
64+
Revoke Moderator
65+
</StyledMenuItemOrange>
66+
) : (
67+
<StyledMenuItemGreen
68+
onClick={() => {
69+
SetIdentityPermissionModeratorReducer.call(selectedGuest.identity);
70+
handleClose();
71+
}}
72+
>
73+
Grant Moderator
74+
</StyledMenuItemGreen>
75+
)}
76+
<StyledMenuItemRed
77+
onClick={() => {
78+
KickGuestReducer.call(selectedGuest.identity);
79+
handleClose();
80+
}}
81+
>
82+
Kick Guest
83+
</StyledMenuItemRed>
84+
</>
7385
) : (
7486
<></>
7587
)}
@@ -81,13 +93,41 @@ export const GuestListContextMenu = (props: IProps) => {
8193
);
8294
};
8395

84-
const StyledMenuItem = styled(MenuItem)`
96+
const StyledMenuItemGreen = styled(MenuItem)`
8597
&:hover {
8698
background-color: #001529;
8799
}
88100
101+
color: #008205;
102+
103+
padding-left: 5px;
104+
105+
margin-left: 5px;
106+
margin-right: 5px;
107+
`;
108+
109+
const StyledMenuItemOrange = styled(MenuItem)`
110+
&:hover {
111+
background-color: #001529;
112+
}
113+
114+
color: #CC5500;
115+
89116
padding-left: 5px;
90117
91118
margin-left: 5px;
92119
margin-right: 5px;
93120
`;
121+
122+
const StyledMenuItemRed = styled(MenuItem)`
123+
&:hover {
124+
background-color: #001529;
125+
}
126+
127+
color: #800000;
128+
129+
padding-left: 5px;
130+
131+
margin-left: 5px;
132+
margin-right: 5px;
133+
`;

0 commit comments

Comments
 (0)