Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(ui-date-time-input): fix Calendar and DateTimeInput page examples clipped off in docs #1858

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions packages/__docs__/src/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import type {
ParsedDocSummary
} from '../../buildScripts/DataTypes.mjs'
import { logError } from '@instructure/console'
import type { Spacing } from '@instructure/emotion'

type AppContextType = {
themeKey: keyof MainDocsData['themes']
Expand Down Expand Up @@ -482,14 +483,7 @@ class App extends Component<AppProps, AppState> {
const themeVariables = themes[themeKey!].resource
const heading = currentData.extension !== '.md' ? currentData.title : ''
const documentContent = (
<View
as="div"
padding={
layout === 'small' || layout === 'medium'
? 'x-large none none large'
: 'x-large none none'
}
>
<View as="div" padding="x-large none none">
{this.renderThemeSelect()}
<View
elementRef={this.mainContentRef}
Expand All @@ -511,12 +505,14 @@ class App extends Component<AppProps, AppState> {
</View>
</View>
)
return this.renderWrappedContent(documentContent)
const padding: Spacing =
layout === 'small' ? 'large small large small' : 'large'
return this.renderWrappedContent(documentContent, padding)
}

renderWrappedContent(
content: ReactElement[] | ReactElement,
padding: any = 'large'
padding: Spacing = 'large'
) {
return <ContentWrap padding={padding}>{content}</ContentWrap>
}
Expand Down Expand Up @@ -701,7 +697,8 @@ class App extends Component<AppProps, AppState> {
shape="circle"
color="secondary"
size="medium"
aria-expanded={true} />
aria-expanded={true}
/>
</InstUISettingsProvider>
</View>

Expand Down Expand Up @@ -824,6 +821,9 @@ class App extends Component<AppProps, AppState> {
<div css={this.props.styles?.hamburger}>
<InstUISettingsProvider>
<IconButton
themeOverride={{
secondaryBorderColor: '#343434'
}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the hamburger menu is overlapping the content, so I made its border have a bit more contrast

Copy link
Contributor

@joyenjoyer joyenjoyer Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the designers agree to make this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They dont have to agree on smaller changes in our docs app :)

onClick={this.handleMenuOpen}
elementRef={this.handleMenuTriggerRef}
renderIcon={IconHamburgerSolid}
Expand Down
16 changes: 8 additions & 8 deletions packages/ui-date-time-input/src/DateTimeInput/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The component is localized via its `locale` and `timezone` parameters. Both are
class Example extends React.Component {
render() {
return (
<div style={{ height: '10rem', width: '40em' }}>
<div style={{ height: '15rem' }}>
<DateTimeInput
description="Pick a date and time"
datePlaceholder="Choose a date"
Expand All @@ -45,7 +45,7 @@ The component is localized via its `locale` and `timezone` parameters. Both are
- ```js
const Example = () => {
return (
<div style={{ height: '10rem', width: '40em' }}>
<div style={{ height: '15rem' }}>
<DateTimeInput
description="Pick a date and time"
datePlaceholder="Choose a date"
Expand Down Expand Up @@ -98,7 +98,7 @@ This sample code also allows the user to enter an arbitrary time value by settin
? new Date(this.state.value).toString()
: 'N/A'
return (
<div style={{ width: '25em' }}>
<div>
<div style={{ marginBottom: '1em', fontStyle: 'italic' }}>
You entered:
<br />
Expand Down Expand Up @@ -155,7 +155,7 @@ This sample code also allows the user to enter an arbitrary time value by settin
const text = value ? new Date(value).toString() : 'N/A'

return (
<div style={{ width: '25em' }}>
<div>
<div style={{ marginBottom: '1em', fontStyle: 'italic' }}>
You entered:
<br />
Expand Down Expand Up @@ -214,7 +214,7 @@ type: example
render() {
return (
<ApplyLocale locale="fr" timezone="Africa/Nairobi">
<div style={{ height: '12rem', width: '40em' }}>
<div style={{ height: '14rem' }}>
<DateTimeInput
description="Pick a date and time"
datePlaceholder="Choose a date"
Expand All @@ -240,7 +240,7 @@ type: example
const Example = () => {
return (
<ApplyLocale locale="fr" timezone="Africa/Nairobi">
<div style={{ height: '12rem', width: '40em' }}>
<div style={{ height: '14rem' }}>
<DateTimeInput
description="Pick a date and time"
datePlaceholder="Choose a date"
Expand Down Expand Up @@ -304,7 +304,7 @@ type: example
}
render() {
return (
<div style={{ height: '12rem', width: '40em' }}>
<div style={{ height: '15rem' }}>
<DateTimeInput
description="Pick a date and time"
datePlaceholder="Choose a date"
Expand Down Expand Up @@ -349,7 +349,7 @@ type: example
}

return (
<div style={{ height: '12rem', width: '40em' }}>
<div style={{ height: '15rem' }}>
<DateTimeInput
description="Pick a date and time"
datePlaceholder="Choose a date"
Expand Down
Loading