-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Agent Builder] Landing Page - Change layout and add quick links #235240
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
Changes from all commits
65011c6
3c696d9
fcaf19b
c3cc0c0
e4b0056
7225a87
b588eb6
4ff6ef6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import { useEuiTheme } from '@elastic/eui'; | ||
|
|
||
| export const useConversationGridCenterColumnWidth = () => { | ||
| const { euiTheme } = useEuiTheme(); | ||
| const contentMaxWidth = `calc(${euiTheme.size.xl} * 25)`; | ||
zacharyparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return contentMaxWidth; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,9 @@ | |
| import { useEuiTheme } from '@elastic/eui'; | ||
| import { css } from '@emotion/react'; | ||
| import React from 'react'; | ||
| import { useConversationGridCenterColumnWidth } from './conversation_grid.styles'; | ||
|
|
||
| // Main grid | ||
|
|
||
| interface ConversationGridProps { | ||
| children: React.ReactNode; | ||
|
|
@@ -17,10 +20,13 @@ interface ConversationGridProps { | |
| export const ConversationGrid: React.FC<ConversationGridProps> = ({ children, className }) => { | ||
| const { euiTheme } = useEuiTheme(); | ||
| const sideColumnWidth = `minmax(calc(${euiTheme.size.xxl} * 2), 1fr)`; | ||
| const contentMaxWidth = `calc(${euiTheme.size.xl} * 25)`; | ||
| const contentMarginWidth = euiTheme.size.l; | ||
| const centerColumnWidth = useConversationGridCenterColumnWidth(); | ||
| const gridStyles = css` | ||
| display: grid; | ||
| grid-template-columns: ${sideColumnWidth} minmax(auto, ${contentMaxWidth}) ${sideColumnWidth}; | ||
| grid-template-columns: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where is tailwind css when we need it ....
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've actually never used Tailwind in any larger project. Pretty used to using CSS-in-JS
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does tailwind have good utility classes for CSS grid? I can't imagine that's much easier to read/write is it? |
||
| ${sideColumnWidth} ${contentMarginWidth} minmax(auto, ${centerColumnWidth}) | ||
| ${contentMarginWidth} ${sideColumnWidth}; | ||
| align-items: center; | ||
| width: 100%; | ||
| `; | ||
|
|
@@ -32,22 +38,88 @@ export const ConversationGrid: React.FC<ConversationGridProps> = ({ children, cl | |
| ); | ||
| }; | ||
|
|
||
| interface ConversationContentProps { | ||
| interface ConversationGridContainerProps { | ||
| children: React.ReactNode; | ||
| className?: string; | ||
| } | ||
|
|
||
| const contentStyles = css` | ||
| grid-column: 2; | ||
| // Left side column | ||
|
|
||
| const leftContainerStyles = css` | ||
| grid-column: 1; | ||
| `; | ||
|
|
||
| export const ConversationLeft: React.FC<ConversationGridContainerProps> = ({ | ||
| children, | ||
| className, | ||
| }) => { | ||
| return ( | ||
| <div css={leftContainerStyles} className={className}> | ||
| {children} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| // Center column without the margins | ||
|
|
||
| const centerContainerStyles = css` | ||
| grid-column: 3; | ||
| `; | ||
|
|
||
| export const ConversationCenter: React.FC<ConversationGridContainerProps> = ({ | ||
| children, | ||
| className, | ||
| }) => { | ||
| return ( | ||
| <div css={centerContainerStyles} className={className}> | ||
| {children} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| // Right side column | ||
|
|
||
| const rightContainerStyles = css` | ||
| grid-column: 5; | ||
| `; | ||
|
|
||
| export const ConversationRight: React.FC<ConversationGridContainerProps> = ({ | ||
| children, | ||
| className, | ||
| }) => { | ||
| return ( | ||
| <div css={rightContainerStyles} className={className}> | ||
| {children} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| // Shorthand for using centered content in the grid | ||
zacharyparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| export const ConversationContent: React.FC<ConversationGridContainerProps> = ({ | ||
| children, | ||
| className, | ||
| }) => { | ||
| return ( | ||
| <ConversationGrid className={className}> | ||
| <ConversationCenter>{children}</ConversationCenter> | ||
| </ConversationGrid> | ||
| ); | ||
| }; | ||
|
|
||
| // Shorthand for using centered content with margins in the grid | ||
|
|
||
| const contentWithMarginsStyles = css` | ||
| grid-column: 2 / 5; | ||
| `; | ||
|
|
||
| export const ConversationContent: React.FC<ConversationContentProps> = ({ | ||
| export const ConversationContentWithMargins: React.FC<ConversationGridContainerProps> = ({ | ||
| children, | ||
| className, | ||
| }) => { | ||
| return ( | ||
| <ConversationGrid className={className}> | ||
| <div css={contentStyles}>{children}</div> | ||
| <div css={contentWithMarginsStyles}>{children}</div> | ||
| </ConversationGrid> | ||
| ); | ||
| }; | ||
Uh oh!
There was an error while loading. Please reload this page.