-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: improve mobile UX for Specification Explorer with content-first layout and toggle #5107
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
base: master
Are you sure you want to change the base?
Changes from all commits
bba3f84
464d97b
dd9b8d5
78b5986
96bee42
9027b72
a0927ab
597dce4
517a79b
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 |
|---|---|---|
|
|
@@ -32,4 +32,4 @@ knowledge_base: | |
| issues: | ||
| scope: "local" | ||
| pull_requests: | ||
| scope: "local" | ||
| scope: "local" | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import 'schyma/dist/esm/style.css'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import type { JSONSchema7Object } from 'json-schema'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import React from 'react'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import React, { useState } from 'react'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import Schyma from 'schyma'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import schema from '../../config/3.0.0.json'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -12,8 +12,18 @@ const typeSchema = schema as unknown as JSONSchema7Object; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * @description This component renders the spec explorer. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| function Visualizer() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const [showMap, setShowMap] = useState(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className={`visualizer-container ${showMap ? 'show-map' : ''}`}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className='mobile-toggle px-4'> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <button | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onClick={() => setShowMap(!showMap)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| className='bg-primary-500 hover:bg-primary-600 text-white font-bold py-2 px-4 rounded mb-2 mt-4 w-full' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {showMap ? 'Hide Visual Map' : 'Show Visual Map'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
14
to
+26
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. Add The toggle controls visibility of the visual map but lacks ♿ Proposed fix <button
+ aria-expanded={showMap}
onClick={() => setShowMap(!showMap)}
className='bg-primary-500 hover:bg-primary-600 text-white font-bold py-2 px-4 rounded mb-2 mt-4 w-full'
>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Schyma | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| title='AsyncAPI Specification' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description="The AsyncAPI Specification defines a set of fields that can be used in an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.