Skip to content

Commit c3fd3a4

Browse files
committed
Add in footer type switching based on url parameter
1 parent b38e134 commit c3fd3a4

File tree

1 file changed

+12
-1
lines changed
  • src/shared/components/TopcoderFooter

1 file changed

+12
-1
lines changed

src/shared/components/TopcoderFooter/index.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default function TopcoderFooter() {
88
const footerRef = useRef();
99
const footerInitialized = useRef(false);
1010
const [footerId, setFooterId] = useState(0);
11+
const urlParams = new URLSearchParams(window.location.href);
1112

1213
useEffect(() => {
1314
uniqueId += 1;
@@ -20,10 +21,20 @@ export default function TopcoderFooter() {
2021
}
2122

2223
footerInitialized.current = true;
24+
let { fullFooter } = getSubPageConfiguration();
25+
26+
// If url contains navTool url parameter. Overwrite settings with parameter.
27+
if (urlParams.get('navTool')) {
28+
if (urlParams.get('navTool') === 'tool') {
29+
fullFooter = false;
30+
} else {
31+
fullFooter = true;
32+
}
33+
}
2334

2435
tcUniNav('init', `footerNav-${footerId}`, {
2536
type: 'footer',
26-
fullFooter: getSubPageConfiguration().fullFooter,
37+
fullFooter,
2738
});
2839
}, [footerId]);
2940

0 commit comments

Comments
 (0)