Skip to content

Commit 8481e78

Browse files
committed
fix: added new features to docs
1 parent 8faccf9 commit 8481e78

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/components/docs/plugin-docs/Tabs.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
- Changing Tabs
1212
- Reordering Tabs
1313
- Hiding Tabs
14+
- Duplicating Tabs
1415
- Removing Tabs
16+
- Sharing Tabs
1517

1618
<br/>
1719

@@ -87,11 +89,20 @@ Tabs can be hidden from the library as well. This means they won't appear in you
8789

8890
<br/>
8991

92+
### Duplicating Tabs
93+
Tabs can be duplicated from either the Library Context Menu or the QAM Menu. This will bring you to the "Create Tab" modal with the filters pre-filtered.
94+
95+
<br/>
9096

9197
### Removing Tabs (Custom Tabs Only)
9298
If you decide your custom tab just isn't cutting it, you can completely remove it too. To do this, navigate to the tab's menu (the same one where you edit and hide tabs), and click `delete`. You will be prompted to confirm (as this can't be undone!), and once you do, the tab will be perminantly removed from TabMaster.
9399

94100
<br/>
95101

102+
### Sharing Tabs
103+
Tabs can be shared with other users on your device. Simply toggle "Other users can copy this tab" to true, and it will show up for them in the shared tabs modal.
104+
105+
<br/>
106+
96107

97108
###### © Travis Lane (Tormak), Jessebofill

src/components/modals/SharedTabsModal.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { showModalDuplicateTab } from "./EditTabModal";
1818
import { SharedTabsModalStyles } from "../styles/SharedTabsStyles";
1919
import { SharedTabAccordion } from "../accordions/SharedTabAccordion";
2020
import { FaRegWindowMaximize } from "react-icons/fa6";
21-
import { useTabMasterContext } from "../../state/TabMasterContext";
2221

2322
type UserTabProps = {
2423
tab: TabSettings,
@@ -51,24 +50,25 @@ const UserTab: VFC<UserTabProps> = ({ tab, closeModal, onConfirm }: UserTabProps
5150
export type SharedTabsModalProps = {
5251
closeModal?: () => void,
5352
onConfirm: (tabSettings: TabSettings) => void,
53+
tabMasterManager: TabMasterManager,
5454
}
5555

56-
export const SharedTabsModal: VFC<SharedTabsModalProps> = ({ closeModal, onConfirm }: SharedTabsModalProps) => {
56+
export const SharedTabsModal: VFC<SharedTabsModalProps> = ({ closeModal, onConfirm, tabMasterManager }: SharedTabsModalProps) => {
5757
const [loading, setLoading] = useState(true);
5858
const [sharedTabs, setSharedTabs] = useState<Record<string, TabSettingsDictionary>>({});
5959

60-
const tabMasterManager = useTabMasterContext()
60+
const { currentUsersFriends } = useMemo(() => tabMasterManager.getFriendsAndTags(), [tabMasterManager]);
6161

6262
const tabsByUser: { user: string, tabs: TabSettings[] }[] = useMemo(() => {
6363
if (loading) return [];
6464

6565
return Array.from(Object.entries(sharedTabs).map(([userId, tabs]) => {
6666
return {
67-
user: tabMasterManager.currentUsersFriends.find((friend) => friend.steamid.toString() === userId)?.name ?? userId,
67+
user: currentUsersFriends.find((friend) => friend.steamid.toString() === userId)?.name ?? userId,
6868
tabs: Array.from(Object.values(tabs))
6969
};
7070
}));
71-
}, [sharedTabs, tabMasterManager.currentUsersFriends]);
71+
}, [sharedTabs, currentUsersFriends]);
7272

7373
useEffect(() => {
7474
PythonInterop.getSharedTabs().then((res) => {
@@ -145,6 +145,7 @@ export function showModalSharedTabs(tabMasterManager: TabMasterManager) {
145145

146146
showModalDuplicateTab(container, tabMasterManager);
147147
}}
148+
tabMasterManager={tabMasterManager}
148149
/>
149150
);
150151
}

0 commit comments

Comments
 (0)