Abin Simon a5ad6e6788
Rework CI to handle combined website and docs (#1568)
## Description

This reworks CI now that we have merged docs and website into a single deployment.

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 💻 CI/Deployment
- [ ] 🐹 Trivial/Minor

## Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* Fixes https://github.com/alcionai/corso/issues/1551

## Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
2022-12-01 16:50:04 +00:00

39 lines
1.0 KiB
JavaScript

import { Icon } from "@iconify/react";
import React, { useEffect } from "react";
export default function BackToTop() {
function scroll() {
window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
}
function scrollFunction() {
var mybutton = document.getElementById("back-to-top");
if (mybutton != null) {
if (
document.body.scrollTop > 500 ||
document.documentElement.scrollTop > 500
) {
mybutton.classList.add("flex");
mybutton.classList.remove("hidden");
} else {
mybutton.classList.add("hidden");
mybutton.classList.remove("flex");
}
}
}
useEffect(() => {
window.onscroll = function () {
scrollFunction();
};
}, []);
return (
<a
href="#"
onClick={() => scroll()}
id="back-to-top"
className="back-to-top flex-col justify-center items-center fixed hidden text-lg rounded-full z-10 bottom-5 right-5 h-9 w-9 text-center bg-indigo-600 text-white leading-9"
>
<Icon icon="mdi:arrow-up" color="#fff" />
</a>
);
}