Skip to content

Commit

Permalink
Merge pull request #217 from TogetherCrew/fix/platform-page
Browse files Browse the repository at this point in the history
change platform page
  • Loading branch information
mehdi-torabiv authored Dec 11, 2023
2 parents 8d4a00d + 5ea8947 commit b877667
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
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;

0 comments on commit b877667

Please sign in to comment.