瀏覽代碼

add comments

Yuki Takei 1 年之前
父節點
當前提交
9ddc6efabc
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      apps/app/src/client/components/PageHeader/PageTitleHeader.tsx

+ 2 - 0
apps/app/src/client/components/PageHeader/PageTitleHeader.tsx

@@ -103,6 +103,7 @@ export const PageTitleHeader = (props: Props): JSX.Element => {
 
   const isInvalid = validationResult != null;
 
+  // calculate inputMaxWidth as the maximum width of AutoSizeInput minus the width of WIP badge and CopyDropdown
   const inputMaxWidth = useMemo(() => {
     if (maxWidth == null) {
       return undefined;
@@ -115,6 +116,7 @@ export const PageTitleHeader = (props: Props): JSX.Element => {
     return getAdjustedMaxWidthForAutosizeInput(maxWidth, 'md', validationResult != null ? false : undefined) - wipBadgeAndCopyDropdownWidth;
   }, [currentPage.wip, maxWidth, validationResult]);
 
+  // calculate h1MaxWidth as the inputMaxWidth plus padding
   const h1MaxWidth = useMemo(() => {
     if (inputMaxWidth == null) {
       return undefined;