Skip to content

Commit 43b90d0

Browse files
committed
Add TwitchPanelLayout and setup in NextJS
refs TS-1656 TS-1658
1 parent 7ce66e6 commit 43b90d0

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { ProfilePanelLayout } from "@thunderstore/cyberstorm";
2+
3+
export default function Communities() {
4+
return (
5+
<div>
6+
<ProfilePanelLayout />
7+
</div>
8+
);
9+
}
32.9 KB
Loading
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { ProfilePanel } from "../../ProfilePanel/ProfilePanel";
2+
3+
/**
4+
* Cyberstorm TwitchPanelLayout Layout
5+
*/
6+
export function TwitchProfilePanelLayout() {
7+
const profile = getProfileData();
8+
return <ProfilePanel profile={profile} />;
9+
}
10+
11+
TwitchProfilePanelLayout.displayName = "ProfilePanelLayout";
12+
TwitchProfilePanelLayout.defaultProps = {};
13+
14+
function getProfileData() {
15+
return {
16+
code: "TEST_CODE",
17+
name: "TEST_NAME",
18+
mods: [
19+
{ name: "TEST_MOD_NAME_1", version: "0.0.1", url: "example.com" },
20+
{ name: "TEST_MOD_NAME_2", version: "0.0.2", url: "example.com" },
21+
{ name: "TEST_MOD_NAME_3", version: "0.0.3", url: "example.com" },
22+
],
23+
};
24+
}

packages/cyberstorm/src/components/ProfilePanel/ProfilePanel.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react";
21
import styles from "./ProfilePanel.module.css";
32
import { faArrowUpRightFromSquare } from "@fortawesome/free-solid-svg-icons";
43
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -24,7 +23,7 @@ export interface ProfilePanelProps {
2423
/**
2524
* Cyberstorm ProfilePanel component
2625
*/
27-
export const ProfilePanel: React.FC<ProfilePanelProps> = (props) => {
26+
export function ProfilePanel(props: ProfilePanelProps) {
2827
const { profile } = props;
2928

3029
return (
@@ -54,6 +53,6 @@ export const ProfilePanel: React.FC<ProfilePanelProps> = (props) => {
5453
</div>
5554
</div>
5655
);
57-
};
56+
}
5857

5958
ProfilePanel.displayName = "ProfilePanel";

packages/cyberstorm/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export * from "./components/Layout/PackageDetailLayout/PackageDetailLayout";
2929
export * from "./components/Layout/PackageListLayout/PackageListLayout";
3030
export * from "./components/Layout/Settings/SettingsLayout";
3131
export * from "./components/Layout/Teams/TeamsLayout";
32+
export * from "./components/Layout/TwitchProfilePanelLayout/TwitchProfilePanelLayout";
3233

3334
export * from "./components/Layout/Developers/ManifestValidator/ManifestValidatorLayout";
3435
export * from "./components/Layout/Developers/MarkdownPreview/MarkdownPreviewLayout";

0 commit comments

Comments
 (0)