Add inline code documentation
This commit is contained in:
parent
6867984659
commit
21d63be4b4
10 changed files with 12 additions and 0 deletions
|
|
@ -54,6 +54,7 @@ export default function ParameterComponent({
|
||||||
const { closePopUp } = useContext(PopUpContext);
|
const { closePopUp } = useContext(PopUpContext);
|
||||||
const { setTabsState, tabId, save } = useContext(TabsContext);
|
const { setTabsState, tabId, save } = useContext(TabsContext);
|
||||||
|
|
||||||
|
// Update component position
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (ref.current && ref.current.offsetTop && ref.current.clientHeight) {
|
if (ref.current && ref.current.offsetTop && ref.current.clientHeight) {
|
||||||
setPosition(ref.current.offsetTop + ref.current.clientHeight / 2);
|
setPosition(ref.current.offsetTop + ref.current.clientHeight / 2);
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ export default function FloatComponent({
|
||||||
const min = 0;
|
const min = 0;
|
||||||
const max = 1;
|
const max = 1;
|
||||||
|
|
||||||
|
// Clear component state
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
setMyValue("");
|
setMyValue("");
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ export default function Header() {
|
||||||
|
|
||||||
const [stars, setStars] = useState(null);
|
const [stars, setStars] = useState(null);
|
||||||
|
|
||||||
|
// Get and set numbers of stars on header
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchStars() {
|
async function fetchStars() {
|
||||||
const starsCount = await getRepoStars("logspace-ai", "langflow");
|
const starsCount = await getRepoStars("logspace-ai", "langflow");
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ export default function InputComponent({
|
||||||
const { setDisableCopyPaste } = useContext(TabsContext);
|
const { setDisableCopyPaste } = useContext(TabsContext);
|
||||||
const { closePopUp } = useContext(PopUpContext);
|
const { closePopUp } = useContext(PopUpContext);
|
||||||
|
|
||||||
|
// Clear component state
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
setMyValue("");
|
setMyValue("");
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ export default function InputFileComponent({
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const { setErrorData } = useContext(alertContext);
|
const { setErrorData } = useContext(alertContext);
|
||||||
const { tabId } = useContext(TabsContext);
|
const { tabId } = useContext(TabsContext);
|
||||||
|
|
||||||
|
// Clear component state
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
setMyValue("");
|
setMyValue("");
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ export default function IntComponent({
|
||||||
const min = 0;
|
const min = 0;
|
||||||
const { closePopUp } = useContext(PopUpContext);
|
const { closePopUp } = useContext(PopUpContext);
|
||||||
|
|
||||||
|
// Clear component state
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
setMyValue("");
|
setMyValue("");
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ export default function TextAreaComponent({
|
||||||
const { openPopUp, closePopUp } = useContext(PopUpContext);
|
const { openPopUp, closePopUp } = useContext(PopUpContext);
|
||||||
const { setDisableCopyPaste } = useContext(TabsContext);
|
const { setDisableCopyPaste } = useContext(TabsContext);
|
||||||
|
|
||||||
|
// Clear text area
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
setMyValue("");
|
setMyValue("");
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ export default function ToggleComponent({
|
||||||
setEnabled,
|
setEnabled,
|
||||||
disabled,
|
disabled,
|
||||||
}: ToggleComponentType) {
|
}: ToggleComponentType) {
|
||||||
|
|
||||||
|
// set component state as disabled
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
setEnabled(false);
|
setEnabled(false);
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ export default function CodeAreaModal({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for custom code errors
|
||||||
function handleClick() {
|
function handleClick() {
|
||||||
postValidateCode(code)
|
postValidateCode(code)
|
||||||
.then((apiReturn) => {
|
.then((apiReturn) => {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ export default function CommunityPage() {
|
||||||
}
|
}
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
// Show community examples on page start
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleExamples();
|
handleExamples();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue