For each wedge, you could have:
- To boost from 3.7V battery to 12V: **broken link removed**
- For the switch, you could use a touch switch, configured for toggle mode: **broken link removed** The output of this switch can connect to pin 4 (MT3608 enable pin) of the IC on the boost converter.
- To charge and protect the battery: https://www.ebay.com.au/itm/164271308971
The main wedge is the same as the others, except it has the charging socket exposed.
The 5V from the charger can be passed through the magnets, provided you're using those with a conductive coating, i.e. Ni coated neodymium types.
If you want to have charging only enabled when all four are connected together, you could have three loops (via the magnets) around assembled lamp, where one loop is the 0V connection, one is 5V in, and one is 5V charge. The 5V and 5V charge loops are connected in the main wedge, such that the 5V in is only connected to the 5V charge loop when all wedges are connected.