Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change platform page #217

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ function TcConnectedPlatformsItem({ platform }: TcConnectedPlatformsItemProps) {
<BsThreeDots
className="cursor-pointer text-gray-400"
onClick={() =>
router.push(`/community-settings/platform/${platform.id}/`)
router.push(
`/community-settings/platform/?platformId=${platform.id}`
)
}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/communitySettings/platform/TcPlatform.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function TcPlatform({ platformName = 'Discord' }: TcPlatformProps) {

const { refreshData, selectedSubChannels } = channelContext;

const id = router.query.id as string;
const id = router.query.platformId as string;

const fetchPlatform = async () => {
if (id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function TcPlatformChannelList({
const channelContext = useContext(ChannelContext);
const router = useRouter();

const id = Array.isArray(router.query.id)
? router.query.id[0]
: router.query.id;
const id = Array.isArray(router.query.platformId)
? router.query.platformId[0]
: router.query.platformId;

const {
channels,
Expand Down
3 changes: 0 additions & 3 deletions src/context/ChannelContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ export const ChannelProvider = ({ children }: ChannelProviderProps) => {
const data = await retrievePlatformProperties({ property, platformId });
setChannels(data);
if (selectedChannels) {
console.log('dsd');

updateSelectedSubChannels(data, selectedChannels);
} else {
const newSelectedSubChannels = data.reduce(
Expand Down Expand Up @@ -171,7 +169,6 @@ export const ChannelProvider = ({ children }: ChannelProviderProps) => {

updatedSelectedSubChannels[channel.channelId] = channelUpdates;
});
console.log({ updatedSelectedSubChannels });

return updatedSelectedSubChannels;
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/callback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function Callback() {
if (!data) {
router.push('community-settings');
}
router.push(`/community-settings/platform/${data.id}`);
router.push(`/community-settings/platform/?platformId=${data.id}`);
} catch (error) {
console.error('Failed to create new platform:', error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import TcBreadcrumbs from '../../../components/shared/TcBreadcrumbs';
import { ChannelProvider } from '../../../context/ChannelContext';
import { defaultLayout } from '../../../layouts/defaultLayout';

function PlatformConfigurations() {
function Index() {
return (
<>
<ChannelProvider>
Expand All @@ -23,6 +23,6 @@ function PlatformConfigurations() {
);
}

PlatformConfigurations.pageLayout = defaultLayout;
Index.pageLayout = defaultLayout;

export default PlatformConfigurations;
export default Index;
Loading