-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MPR Refactor duplicate search code in homejs and devicejs
Refactor duplicate search code in homejs and devicejs
- Loading branch information
Showing
14 changed files
with
131 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
import "./search.css"; | ||
import { DEVICE_MANAGER } from "../../scripts/deviceManager"; | ||
import { getModelItems, getBrandItems } from "../../scripts/algolia/generate"; | ||
const modelItems = getModelItems(DEVICE_MANAGER); | ||
const brandItems = getBrandItems(DEVICE_MANAGER); | ||
interface Props { | ||
id: string; | ||
} | ||
const { id } = Astro.props; | ||
--- | ||
|
||
<script define:vars={{ modelItems, brandItems, containerId: id }}> | ||
window.modelItems = modelItems; | ||
window.brandItems = brandItems; | ||
if (window.containerIds != null) { | ||
window.containerIds.push(containerId); | ||
} else { | ||
window.containerIds = [containerId]; | ||
} | ||
</script> | ||
|
||
<> | ||
<div id={id}></div> | ||
<script src="./search.js"></script> | ||
</> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.