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
ui: use route location instead of window.location (PROJQUAY-5392) #1844
Conversation
window.location causes issues when running in beta or preview on console
@@ -69,6 +69,9 @@ export default function RepositoriesList(props: RepositoriesListProps) { | |||
const [makePublicModalOpen, setmakePublicModal] = useState(false); | |||
const [makePrivateModalOpen, setmakePrivateModal] = useState(false); | |||
const [err, setErr] = useState<string[]>(); | |||
const location = useLocation(); | |||
|
|||
console.log('current route location', location.pathname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the console.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -414,3 +429,7 @@ interface RepoListTableItem { | |||
size: number; | |||
last_modified: number; | |||
} | |||
|
|||
interface RepositoriesListProps { | |||
organizationName: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for adding the props here? I don't see the organizationName
getting used in the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see RepositoriesListProps
used in src/routes/RepositoriesList/RepositoriesList.tsx:65
but it's not defined so I'm defining it
@@ -20,6 +20,7 @@ function getTabIndex(tab: string) { | |||
export default function TagTabs(props: TagTabsProps) { | |||
const [activeTabKey, setActiveTabKey] = useState<TabIndex>(TabIndex.Details); | |||
const navigate = useNavigate(); | |||
const location = useLocation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
location
here doesn't seem to getting used in the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's used in src/routes/TagDetails/TagDetailsTabs.tsx:35
but not defined in the context which causes issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…ay#1844) * ui: use route location instead of window.location (PROJQUAY-5392) window.location causes issues when running in beta or preview on console * remove console.log
window.location causes issues when running in beta or preview on console