Skip to content

Commit

Permalink
feat(profile-overview): 🎉 add profile overview component
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhangunduz committed Aug 11, 2023
1 parent a3416fb commit c9f4e0e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
24 changes: 24 additions & 0 deletions src/components/ProfileOverview/ProfileOverview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React, { Fragment, ReactElement } from "react";
import ProfileInfo from "../ProfileInfo/ProfileInfo";
import ProfileChangePassword from "../ProfileChangePassword/ProfileChangePassword";
import ProfileEmailPreferances from "../ProfileEmailPreferances/ProfileEmailPreferances";
import ProfileConnectedApps from "../ProfileConnectedApps/ProfileConnectedApps";
import ProfileNotifications from "../ProfileNotifications/ProfileNotifications";
import ProfileDeactive from "../ProfileDeactive/ProfileDeactive";

export default function ProfileOverview(): ReactElement {
return (
<Fragment>
<div className="col-span-1 flex flex-col gap-6">
<ProfileInfo className="col-span-1" />
<ProfileChangePassword className="col-span-1" />
<ProfileEmailPreferances className="col-span-1" />
</div>
<div className="col-span-1 flex flex-col gap-6">
<ProfileConnectedApps className="col-span-1" />
<ProfileNotifications className="col-span-1" />
<ProfileDeactive className="col-span-1" />
</div>
</Fragment>
);
}
16 changes: 2 additions & 14 deletions src/pages/Profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ProfileEmailPreferances from "../../components/ProfileEmailPreferances/Pr
import ProfileDeactive from "../../components/ProfileDeactive/ProfileDeactive";
import ProfileNotifications from "../../components/ProfileNotifications/ProfileNotifications";
import ProfileChangePassword from "../../components/ProfileChangePassword/ProfileChangePassword";
import ProfileOverview from "../../components/ProfileOverview/ProfileOverview";

export default function Profile(): ReactElement {
const [activeTab, setActiveTab] = useState("Overview");
Expand All @@ -20,20 +21,7 @@ export default function Profile(): ReactElement {
{(() => {
switch (activeTab) {
case "Overview":
return (
<Fragment>
<div className="col-span-1 flex flex-col gap-6">
<ProfileInfo className="col-span-1" />
<ProfileChangePassword className="col-span-1" />
<ProfileEmailPreferances className="col-span-1" />
</div>
<div className="col-span-1 flex flex-col gap-6">
<ProfileConnectedApps className="col-span-1" />
<ProfileNotifications className="col-span-1" />
<ProfileDeactive className="col-span-1" />
</div>
</Fragment>
);
return <ProfileOverview />;
case "Profile Info":
return <ProfileInfo className="col-span-2" />;
case "Connected Apps":
Expand Down

0 comments on commit c9f4e0e

Please sign in to comment.